Script Object Order in Script
Script Object Order in Script
- Subject: Script Object Order in Script
- From: Arthur J Knapp <email@hidden>
- Date: Tue, 24 Jul 2001 11:34:32 -0400
Is this a bug, or a feature? :
script aaa
property whatever : "aaa"
end script
on CheckScriptProperties()
whatever of aaa --> "aaa"
whatever of zzz --> error "The variable zzz is not defined."
end CheckScriptProperties
script zzz
property whatever : "zzz"
end script
CheckScriptProperties()
In other words, the handler CheckScriptProperties can't "see"
the script object zzz, appearently because it is defined after
the handler is. I don't understand why it should behave this way.
Handlers have no difficulty calling on other handlers that have
been defined after them, as in:
on HandlerAtTop()
return "HandlerAtTop"
end HandlerAtTop
on CallHandlers()
HandlerAtTop() --> "HandlerAtTop"
HandlerAtBottom() --> "HandlerAtBottom"
end CallHandlers
on HandlerAtBottom()
return "HandlerAtBottom"
end HandlerAtBottom
CallHandlers()
It seems to me that after the script has been compiled, all
script objects defined at the top-level of the script should
be just as "global" as all handler definitions.
Arthur J. Knapp
http://www.stellarvisions.com
mailto:email@hidden
Hey, check out:
http://www.vivaladata.com