Finding the Position of an item in a list
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