Re: Considering case...
Re: Considering case...
- Subject: Re: Considering case...
- From: Bill Cheeseman <email@hidden>
- Date: Sat, 22 Feb 2014 15:13:10 -0500
On Feb 22, 2014, at 2:46 PM, David Crowe < email@hidden> wrote: I think the problem is that I'm relying on AppleScript to convert the letter for the arithmetic comparison. The following code works properly:
set c to "E" considering case set cnum to (ASCII number c) if (ASCII number "a") ≤ cnum and cnum ≤ (ASCII number "z") then display dialog "Character '" & c & "' is lower case." else if (ASCII number "A") ≤ cnum and cnum ≤ (ASCII number "Z") then display dialog "Character '" & c & "' is upper case." end if end considering
More cumbersome, but more explicit.
No, the AppleScript Language Guide (2013) at page 242 expressly states that the 'less than' and related operators work with text as well as date and numeric values. It's always been that way.
Also, the Guide at pages 138-139 says that 'ASCII number' and 'ASCII character" are deprecated in AppleScript 2.0, because AppleScript text is now based on Unicode. (Although they do work....) As noted in my previous message, the AppleScript 2.0 way to get these values is to use the 'id' property.
|
_______________________________________________
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