Re: Bad Characters
Re: Bad Characters
- Subject: Re: Bad Characters
- From: Luther Fuller <email@hidden>
- Date: Wed, 15 Oct 2008 20:28:12 -0500
Christopher Nebel wrote:
It looks like all non-printing control characters compare as equal.
Try the ASCII control range for comparison. Is this of practical
concern, or are you just poking around?
It started out as a practical concern, trying to find a reason for a
bug in my application.
Turns out this isn't the cause of my bug, so I guess I have
degenerated into poking around.
And Mark J. Reed said:
If you need to compare a character to nul exactly, try taking its id
and comparing it to 0:
if id of testChar = id of nullChar
or just
if id of testChar = 0
The 'id of testChar' is the correct value as set in the script, not 0.
I can scan a string for a character whose id > 0 and take action based
on the value of the id.
I just have to avoid comparing the character to the null character.
We have a situation where:
1. (id of testChar) ≠ 0 is true; and
2. testChar = nullChar is true.
But these are inconsistent truths.
(Mathematicians use the term "inconsistent" where programmers would
use the term "bug".)
Again Mark J. Reed commented:
Luther: I should add that while I proposed a workaround for this
behavior, I would agree that it is incorrect - if not a bug, at least
a misfeature. I think you should open a bug report on it.
I'll report it.
_______________________________________________
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