Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: resetting script between runs




Den 4. jun. 2007 kl. 13.28 skrev Doug McNutt:

At 11:27 +0200 6/4/07, Richard Mayer wrote:
No, globals are not saved between runs, but maybe you're saving some sort of preference?

I do wish I could get that straight.

I once thought that only properties were saved but other posts on this list lead me to conclude that globals ARE saved, perhaps only if they appear in the main part of a script. I now ALWAYS initialize globals specifically.


I did this earlier today:

--
global gtest

set gtest to 1
display dialog "first: " & gtest
set gtest to gtest + 1
display dialog "second: " & gtest
--

Saving it as an application, it behaves as I would expect: counting 1 and 2 on every single run.
It would indicate globals are not saved, at least the value ignored - as opposed to if it has been declared as a property in the first line.


I am a bit confused about this as I have seen several claims globals are saved.

Håvard




_______________________________________________ Do not post admin requests to the list. They will be ignored. AppleScript-Users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/applescript-users/email@hidden Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
References: 
 >resetting script between runs (From: Håvard Graudo <email@hidden>)
 >Re: resetting script between runs (From: Richard Mayer <email@hidden>)
 >Re: resetting script between runs (From: Doug McNutt <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.