Hi Everyone

I am going mad trying to get this basic script to work.

Ok here is the problem, I have a Listview and have inserted the following objects: PC1, PC2, PC3.

Now say I want to have a 'Insert Box' that enters data into the Listview, and in this insert box I type PC1.

I want it to check that PC1 is not already in the Listview already.

I have tried a loop on the ListCount and then Additem if Insert.Text is not the same as List($Loop), but it just repeast it self and I get 20 odd additems.

code:
Function sExcludedListAdd_Click()

If $sExcludedInput.Text = ""
$= $FORM.MsgBox("Invalid Netbios Name","Error")
Else
$x = $sExcludedList.ListCount -1
For $Loop = 0 to $x
If $sExcludedInput.Text = $sExcludedList.List($Loop)
$= $FORM.MsgBox("("+$sExcludedInput.Text") is already in the Excluded List","Error")
Else
$sExcludedList.AddItem($sExcludedInput.Text)
EndIf
Next
EndIf


EndFunction

I just don't know how to do this. ???

Any Ideas.

Thanks

[ 15. August 2003, 12:13: Message edited by: Richard Farthing ]