From: "Thomas Yeh" <[EMAIL PROTECTED]>
> So maybe instead of stepping through the list ourseleves, we can just let
> the underlying C or Assembly code does it for us, as in following handler.
>
> on addItem theList, theItem
> if not ilk(theList, #linearList) then exit
> itemPos = theList.getPos(theItem)
> if itemPos then return itemPos
> theList.add(theItem)
> return theList.getPos(theItem)
> end
Thank you, Thomas.
Yes. You are right when you said that it is case sensitive
as in the following example...
-- Welcome to Director --
put gList
-- ["Earth", "Jupiter", "Mars", "Venus", "Saturn"]
put getPos(gList, "Earth")
-- 1
put getPos(gList, "EARTH")
-- 0
put getPos(gList, "earth")
-- 0
-- Your script at work.
addItem(gList, "earth")
put gList
-- ["Earth", "Jupiter", "Mars", "Venus", "Saturn", "earth"]
addItem(gList, "EARTH")
put gList
-- ["Earth", "Jupiter", "Mars", "Venus", "Saturn", "earth", "EARTH"]
Maybe going through each item on the list is till the safest one.
Thanks again for your help.
John Erazo
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi To post messages to the list,
email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo. Thanks!]