Re: checking values in property problem
Re: checking values in property problem
- Subject: Re: checking values in property problem
- From: John W Baxter <email@hidden>
- Date: Thu, 10 May 2001 22:38:14 -0700
email@hidden wrote:
>
Hi,
>
>
i really can't figure out what i'm doin wrong here:
>
>
>property app_1 : ""
>
>property app_2 : ""
>
>
>if app_1 = "" or app_1 = "" then
>
>-- write something to empty properties..
>
>end if
>
>
The if handler simply ignores the contents of the properties.. no matter
>
what i try, or if i try different notation like property app_1 : 0 or
>
property app_1 : {} the whole if construction is simply skipped...
>
>
Dunno, i guess there's some basic misunderstanding on my side,
>
so thx for any hint/help...
You had me convinced that there was an error in the short-circuit
evaluation of or, until I noticed that you are testing against the property
app_1 twice, and not testing app_2.
Try
property app_1 : "x"
property app_2 : ""
if app_1 = "" or app_2 = "" then
display dialog "yes"
-- write something to empty properties..
end if
with various values in app_1 and app_2.
It works sensibly for me with that change.
--John
--
John Baxter, Port Ludlow, WA (USA).
middle Wednesday of {Sunday, Monday, Tuesday, Wednesday}
--> Sunday
Darn, a perfectly good signature ruined by AppleScript 1.6 Mac OS X and Mac
OS 9.1. [The above is now an error, not Sunday.] Thanks for the fix,
Chris!