• 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: resetting script between runs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: resetting script between runs


  • Subject: Re: resetting script between runs
  • From: "Nigel Garvey" <email@hidden>
  • Date: Mon, 4 Jun 2007 17:50:15 +0100

Luther Fuller wrote on Mon, 4 Jun 2007 08:42:39 -0500:

>> And "top level" variables count as globals in this respect. If the
>> 'global' declaration above is omitted, runNr still increments over
>> runs.

>I solve this problem by simply avoiding the use of globals. Always.
>My run handlers always start with ...
>
>on run
>	local ...
>
>followed by a list of all "top-level" variables.

I put my main code into an ordinary handler, where variables are local
anyway unless declared otherwise.

  on run
    mainCode()
  end run

  on mainCode()
    ...


NG

 _______________________________________________
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/archives/applescript-users

This email sent to email@hidden

References: 
 >Re: resetting script between runs (From: "Nigel Garvey" <email@hidden>)
 >Re: resetting script between runs (From: Luther Fuller <email@hidden>)

  • Prev by Date: monitor resolution
  • Next by Date: making a new file
  • Previous by thread: Re: resetting script between runs
  • Next by thread: [ANN] FastScripts 2.3.2
  • Index(es):
    • Date
    • Thread