Re: string comparison
Re: string comparison
- Subject: Re: string comparison
- From: Daniel Shockley <email@hidden>
- Date: Mon, 26 Feb 2001 11:04:09 -0800 (PST)
>
Message: 15
>
Date: Mon, 26 Feb 2001 17:38:45 +0100
>
To: email@hidden
>
From: Robert Brenstein <email@hidden>
>
Subject: weird comparison problem
>
>
I have a script (this is a debug version) as part of my AppleScript-based cgi:
------- break
>
if item j of fieldNames is tplSource then -- !!!!!
------- break
>
But I need to check for equal! Anyone any ideas?
>
>
Robert
Did you try using parentheses around the (item j of fieldNames)? It could be that your command is
doing:
if item j of (fieldNames is tplSource) then
Then again, that would probably cause an error, since you can get an item of TRUE or FALSE.
Perhaps you should make sure that (item j of fieldNames) and tplSource are both being evaluated as
text. Try putting these two lines right before your if statement:
log (item j of fieldNames)
log tplSource
Actually, I just tried a little sample of what I recommended, and it seemed that tplSource is
stored as a list of characters, not as a string.
Early in your script, try using this line instead:
set tplSource to (characters 5 thru (length of htmlTemplate) of htmlTemplate) as string
instead of saying "the text of characters", which doesn't seem to give the result as a string.
Hope that helps,
=====
Daniel A. Shockley
email@hidden
And now for a message from my sponsor... *grin*
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/