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



On 6/4/07 at 5:09 AM, Håvard Graudo <email@hidden> spake thusly:

My 4 properties are three booleans (ie. debug: false) + a static string (path to a logfile).
I have three globals. Globals are not saved between runs, right?

Nope, that would be wrong, they are saved. (see below)

Any advise in strategy to choose? How do I get to see what actually fails. (The script may run fine for weeks after a compile.)

Set your properties and globals back to their default values or empty at the end of the run. Declare other variables as local.


Re: Globals, run this script in your script editor and watch the value of "f" at the completion of each run.

--> Cut <--
global f
try
	set f to 1 + f -- errors on first run
on error
	set f to 1 -- first run only
end try
return f
--> Cut <--

JBS
--
Why is a person, who plays the piano, called a pianist but a person who drives a race car not called a racist? - George Carlin
_______________________________________________
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>)



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.