• 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: Håvard Graudo <email@hidden>
  • Date: Mon, 4 Jun 2007 16:11:04 +0200


On Jun 4, 2007, at 8:15 AM, Nigel Garvey wrote:

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

this is a surprise!

I think there was a bug in the earlier versions of Tiger, whereby globals
and properties _didn't_ persist. But that's been fixed for a while now.


To "remove garbage from a script between runs", you can set its globals
to less bulky values (eg. "") before it finishes, or, preferably, use
locals instead.

Den 4. jun. 2007 kl. 15.42 skrev Luther Fuller:
I solve this problem by simply avoiding the use of globals. Always. My run handlers always start with ...



I have a few files with my most used handlers. I have been used to load them like this.
I know I will not change the value, just keep it within reach everywhere, so I thought global was the way to go.
Is there a better way?


Håvard


-- global MyScriptLib

on run
my startup()
my dostuff()
end

on startup()
set MyScriptLib to load script alias somefile
end
--





_______________________________________________
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: view Scale in Quark
  • Next by Date: [ANN] FastScripts 2.3.2
  • Previous by thread: Re: resetting script between runs
  • Next by thread: Re: resetting script between runs
  • Index(es):
    • Date
    • Thread