• 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
Index of Handler
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Index of Handler


  • Subject: Index of Handler
  • From: List Guy <email@hidden>
  • Date: Wed, 11 Jul 2001 10:25:59 -0700

I'd appreciate someone telling me if my supposition about

on IndexOf(lst, itm)
set x to 1
tell no & lst to if {itm} is in it then repeat until item x = itm
set x to x + 1
end repeat
x - 1
end IndexOf

is correct:

"no", the applescript constant for use with the close command, is used here
to substitute for a longer block of code for when itm isn't in lst. I tried
"yes", "all caps" and other constants and all worked. That is, "no" is used
because the indexOf handler assumes that itm will never be the applescript
constant "no".

I suppose that

on IndexOf(lst, itm)
set x to 1
tell missing value & lst
if {itm} is in it then
repeat until item x = itm
set x to x + 1
end repeat
end if
end tell
return x - 1
end IndexOf

might be clearer because it uses the "missing value" constant, except that
soemone might query the list to see if it contains a missing value.

grh


  • Prev by Date: Re: QuarkXpress: Gettings words
  • Next by Date: Re: URLAccess Scripting error -3170
  • Previous by thread: ACGI's
  • Next by thread: Re: Index of Handler
  • Index(es):
    • Date
    • Thread