Re: Scope
Re: Scope
- Subject: Re: Scope
- From: julifos <email@hidden>
- Date: Fri, 13 Dec 2002 09:32:19 +0000
>
Script A:
>
>
global var1
>
>
set var1 to 0
>
>
try
>
>
repeat with i from 1 to 100
>
set var1 to var1 + 1
>
-- do stuff
>
end repeat
>
>
set f to load script alias "path:to:script B"
>
tell f to set var2 to someHandler()
>
>
on error errMsg number errNum
>
my ErrorHandler(errMsg ,errNum)
>
end try
>
>
on ErrorHandler(errMsg, errNum)
>
display dialog errMsg & " " & errNum
>
set g to load script alias "path:to:script C"
>
tell g to set var3 to anotherHandler(var1)
>
end try
>
>
>
Script B: --no run handler
>
>
--no reference at all to var1
>
>
Script C: -- no run handler, only one handler:
>
>
on anotherHandler(var1)
>
--do stuff with var1
>
end anotherHandler
>
>
>
>
A system error (not a display dialog) appears at or near the end of the
>
script run:
>
>
The variable var1 is not defined.
>
>
But only for one user. How can it not be defined?
(?) Since standard applescript can't kill variables, and If you're pretty
sure about this code's structure, seems clearly an user's system error...
JJ
___________
* Sorry about this not-very-impressive opinion ;-)
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.