Hi Chris

Use getPos() function to identify the position of the value in the list. If
the value is not found in the list it returns 0, then add the value.

on addItem theList,theItem
  if not theList.getPos(theItem) then
    theList.add(theItem)
  end if
end

best regards
------------------------------------------
Ramesh CT
http://www.lingoman.net/
------------------------------------------

>>>
Can someone tell me how to go about checking a list for a value,
and adding it only if it isn't in it yet?


[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!]

Reply via email to