From: Daniel Date: 2002-07-02T00:57:56+09:00 Subject: Re: functions need declaring before use Thanks for these suggestions guys. Niklas, your explanation makes a lot of sense. I'm still new to Ruby, but I see what you mean. Thanks for that also. Daniel On Mon, 1 Jul 2002, Pit Capitain wrote: > On 1 Jul 2002, at 17:09, Niklas Frykholm wrote: > > > [Daniel]: > > > I've noticed that functions require that they be declared before > > > they can be used. This came as somewhat as a blow as I orgaznie my > > > code by putting my main code first, and function listing at the end. > > > Is this set in stone? Plans to change? Reasoning? > ... > > If you want to keep your style, I suggest you put your main code > > in a main function and call it at the end of the program. > > > > def main > > ... > > end > > > > ... other functions ... > > > > main() > > You can also use an END block: > > ,----[ script ] > | > | END { > | # main function > | } > | > | # other functions > | > `---- > > Regards, > Pit > -- Newlan's Truism: An "acceptable" level of unemployment means that the government economist to whom it is acceptable still has a job.