Re: Why put all handlers at the top of the script?
Re: Why put all handlers at the top of the script?
- Subject: Re: Why put all handlers at the top of the script?
- From: 2551 <email@hidden>
- Date: Sat, 21 Mar 2015 01:51:15 +0700
> On Mar 20, 2015, at 7:46 AM, S. J. Cunningham <email@hidden> wrote:
>
>> Why put all handlers at the top of the script?
>
I think historically, functions (aka handlers in AS) often needed to be declared first before the compiler encountered them. AFAIK, this have never been true of AS, but may have been true (some greater minds will correct me if I'm wrong) of Pascal, from which I think AS was originally derived.
In my own script editor, it is also necessary to place handlers first if you're using the debugging tools (if you're not, it doesn't make any difference). This is because my debugging tools iterate and execute the script line by line, so any handlers not seen before being encountered will throw an error.
Best
Phil
DisplayDroid beta (a lightweight script editor and automation tool) is now available for free download. More info on sqwarq.com/displaydroid
OSXClock - big, beautiful alarm clock and timer for your mac. More info on sqwarq.com/osxclock
http://applehelpwriter.com
http://sqwarq.com - apps for OS X & iOS
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden