Re: *Very* strange script / global variable behavior
Re: *Very* strange script / global variable behavior
- Subject: Re: *Very* strange script / global variable behavior
- From: has <email@hidden>
- Date: Mon, 28 Feb 2005 22:38:44 +0000
Nigel Garvey wrote:
>And this script object, being the top-level script
object, is created at compile-time; ergo the script object in Outer
is also created at compile-time.
Not according to ASLG, but maybe you have a better source:
The ASLG is mostly incorrect. A named script object declared within
another script object is initialised when the parent script object is
initialised, same as property values and handler objects. Only
unnamed script objects and script objects within declared handlers
are initialised when the relevant code is executed. Simple
demonstration showing when initialisation occurs:
on x(s)
display dialog s & " initialised"
end x
script
property a : x("unnamed script")
end script
script o1
property b : x("script o1")
script o2
property c : x("script o2")
end script
end script
This displays "script o1 initialised" and "script o2 initialised"
when the script is compiled, and "unnamed script initialised" when
run.
HTH
has
http://freespace.virgin.net/hamish.sanderson/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden