Bastien Bouchard wrote:
> 
> > 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?
> 
> An easy way to find if a value is in the list is to use the getPos. In my
> stupid Lingo:
> 
>     valueexist=Getpos(mylist,myvalue) --this will return valueexist=0 if the
> value is'nt in the list
>         if valueexist=0 then
>                 --add it to the list
>         else
>                 nothing

I usually just:
  if not getpos(list, value) then add(list, value)

-- 
Carl West    [EMAIL PROTECTED]
617.262.8830 x246    

I have no superfluous leisure; my stay must be
stolen out of other affairs; but I will attend you awhile.

           - Isabella, Measure for Measure, Act 3 Scene 1

[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