• 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: checking values in property problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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!


References: 
 >checking values in property problem (From: ben gurion <email@hidden>)

  • Prev by Date: SiphonScript surprisingly similar
  • Next by Date: Impossible "If"?
  • Previous by thread: checking values in property problem
  • Next by thread: Re: checking values in property problem
  • Index(es):
    • Date
    • Thread