Re: If Statements
Re: If Statements
- Subject: Re: If Statements
- From: "Nigel Garvey" <email@hidden>
- Date: Sun, 14 Sep 2008 00:08:49 +0100
Ed Stockly wrote on Fri, 12 Sep 2008 23:02:12 -0700:
>set userName to 5
>(userName > 1 and userName < 10)
>-->>true
>set userName to "5"
>(userName > 1 and userName < 10)
>-->>false
Don't forget that, as from Tiger, there's a 'numeric strings' attribute
that can be used in text comparisons:
set userName to "5"
considering numeric strings
(userName > "1" and userName < "10")
end considering
--> true
It also works with automatic coercions:
set userName to "5"
considering numeric strings
(userName > 1 and userName < 10)
end considering
--> true
NG
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden