Re: Property and variable
Re: Property and variable
- Subject: Re: Property and variable
- From: "J. Stewart" <email@hidden>
- Date: Fri, 3 Nov 2006 17:06:32 -0500
On 11/3/06 at -0500 Mark J. Reed said this
>The fact that handlers can't see "global" variables is generally considered
>a good thing. :)
Sorry Mark,
This statement is inaccurate. If it were true this script would not work.
--> Cut <--
global a, b
set a to 3
set b to 4
display dialog my adder() as Unicode text
on adder()
return a + b
end adder
--> Cut <--
It would be more accurate to say - variables in the top level ("on run") handler aren't visible to sub-handlers unless specifically declared as global in scope (see above script) even though they share some of the other aspects of "global" variables.
JBS
--
Get a new car for your spouse. It'll be a great trade!
_______________________________________________
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/mailman//archives/applescript-users
This email sent to email@hidden