From: "Kerry Thompson" <[EMAIL PROTECTED]>
Sent: Tuesday, December 12, 2000 1:28 PM

> John, this line is your problem. You're setting inItem to the value of 
> gList[i]. Try this:
> 
> global gList
> 
> on addItem inItem
>    totalCount = gList.count
>    repeat with i = 1 to totalCount
>      if gList[i] = inItem then
>        alert "Item already exists."
>        return VOID
>      else
>        gList.add(inItem)
>        -- take out the exit repeat
>      end if
>    end repeat
> end

I didn't realized that I was really *putting*
values to inItem because I never used 
the command set.  Very clever !!!

I tried this in the Message window..

-- Welcome to Director --

put gList
-- ["Earth", "Jupiter", "Mars", "Venus", "Saturn"]

set inItem = "Jupiter"

put inItem = gList[2]
-- 1

put inItem = gList[3]
-- 0


Thanks again for all the help.

cheers,
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!]

Reply via email to