Re: Test for existence of a variable?
Re: Test for existence of a variable?
- Subject: Re: Test for existence of a variable?
- From: "Gary (Lists)" <email@hidden>
- Date: Thu, 11 Aug 2005 10:35:51 -0400
"Mark J. Reed" wrote:
> Is there any way to
> test to see if a variable has been defined? This code snippet works great if
> the global variable _ has been assigned a value.
Get familiar with 'try'.
Try, catch the error, do what you want.
> global _
> set saved_ to _
> (* do stuff with _ *)
> set _ to saved_
global someRealVariableNameNotJust_
try
set saved_ to someRealVariableNameNotJust_
-- do stuff with someRealVariableNameNotJust_
on error
-- do other stuff someRealVariableNameNotJust_
end try
...wfm.
--
Gary
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden