• 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
Finding the Position of an item in a list
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Finding the Position of an item in a list


  • Subject: Finding the Position of an item in a list
  • From: Greg Back <email@hidden>
  • Date: Sun, 07 Oct 2001 12:57:39 -0400

Hi all-

Is there any more practical (read "shorter") way to find where in a list a
certain item can be found.

to findPosition(thisItem, thislist)
if thisItem is in thislist then
repeat with i from 1 to (count thislist)
if item i of thislist is thisItem then
set j to i
exit repeat
end if
end repeat
else
set j to "Not in list"
end if
return j
end findPosition

I think this was discussed before but i can't find it in the archives (Am I
blind?)

TIA
--
Greg


  • Prev by Date: Regular Expressions Resources
  • Next by Date: Re: Set Selection with a list of items
  • Previous by thread: Re: Regular Expressions Resources
  • Next by thread: Re: Finding the Position of an item in a list
  • Index(es):
    • Date
    • Thread