• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Scope
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Re: How to check applications already opened
  • Next by Date: OSX pdf file creation
  • Previous by thread: Re: Scope
  • Next by thread: Re: Scope
  • Index(es):
    • Date
    • Thread