• 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: Bad Characters
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bad Characters


  • Subject: Re: Bad Characters
  • From: Luther Fuller <email@hidden>
  • Date: Thu, 16 Oct 2008 08:07:39 -0500

In my original script, I commented: "-- or use nullChar = "".
To emphasize that this is a bug, run this script ...

repeat with charNr from 125 to 165
set testChar to character id charNr
-- class of testChar is text and length of testChar is 1
if testChar = "" then
"empty"
else
"[" & testChar & "]"
end if
display dialog ((charNr as text) & " = " & the result) buttons {"Cancel", "Next"} default button 2
end repeat


'testChar' can never equal the empty string, since it has length = 1 > 0, but
You will find that with some characters, testChar = "" is true.
An empty string with length 1 cannot exist.


Until this bug is fixed, you will have to test for an empty string with
if (length of string) = 0 then

_______________________________________________
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
  • Follow-Ups:
    • Re: Bad Characters
      • From: "Mark J. Reed" <email@hidden>
References: 
 >Bad Characters (From: Luther Fuller <email@hidden>)
 >Re: Bad Characters (From: "Mark J. Reed" <email@hidden>)
 >Re: Bad Characters (From: Luther Fuller <email@hidden>)
 >Re: Bad Characters (From: "Mark J. Reed" <email@hidden>)
 >Re: Bad Characters (From: "Mark J. Reed" <email@hidden>)

  • Prev by Date: Re: Bad Characters
  • Next by Date: Re: Bad Characters
  • Previous by thread: Re: Bad Characters
  • Next by thread: Re: Bad Characters
  • Index(es):
    • Date
    • Thread