Re: Converting characters
Re: Converting characters
- Subject: Re: Converting characters
- From: Paul Berkowitz <email@hidden>
- Date: Tue, 07 Aug 2001 18:07:09 -0700
On 8/7/01 3:13 PM, "Arthur J Knapp" <email@hidden> wrote:
>
> Date: Tue, 07 Aug 2001 12:39:19 -0700
>
> Subject: Re: Converting characters
>
> From: Paul Berkowitz <email@hidden>
>
>
> or else use the ASCII character definitions to be specific:
>
>
>
> if thechar = ASCII character 88 then --upper-case "X"
>
> set newchar to "\\"
>
> else if thechar = ASCII character 90 then --upper-case "Z"
>
> set newchar to "\""
>
> end if
>
>
I'm sorry, Paul, but the above isn't true. Whether you type a
>
literal letter or specify it with the ASCII commands, AppleScript
>
is still going to be case-insensitive by default:
>
>
set theChar to "z" -- lowercase z
>
>
if theChar = ASCII character 90 then -- uppercase Z
>
>
-- this will be true
>
>
else
>
...
>
Thanks for the correction, Arthur. You're right.
>
You would have to also convert theChar for this method to work:
>
>
if (ASCII number theChar) = (ASCII character 90) then
>
...
Don't you mean:
if (ASCII number theChar) = 90 then
?
>
>
Your first suggestion is the best:
>
>
considering case
>
...
>
>
Yup, that's best.
--
Paul Berkowitz