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

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/


  • Prev by Date: Re: Applet's last command doesn't take
  • Next by Date: Re: 2^1024
  • Previous by thread: Re: Scripting icon copying: Finder barfs - howcome?
  • Next by thread: Eudora Attachments?
  • Index(es):
    • Date
    • Thread