Jump to content

Compairing List items


Recommended Posts

I have my script changing the IP. I want it to be able to know if it has used this IP previously, and change it again if the IP has been used before.

My thoughts were to add them to a GUICtrlCreateList and then compare them some how. I did some searching and found a script () that stores the list items in a array.

I updated it so I no longer get syntax errors and now have this

Func IP()
    $PublicIP = _GetIP()
    GUICtrlSetData($IPList, $PublicIP)
    Dim $IP_list
            For $x = 0 To _GUICtrlListBox_GetCount ($IPList) - 1
                If Not IsArray($IP_list) Then
                    Dim $IP_list[1]
                Else
                    ReDim $IP_list[UBound($IP_list) + 1]
                EndIf
                $IP_list[UBound($IP_list) - 1] = _GUICtrlListBox_GetText ($IPList, $x)
            Next
            For $x = 0 To UBound($IP_list) - 1
                MsgBox(0, $x, $IP_list[$x])
            Next
EndFunc

But I still have no idea how to go about searching the array values against the $PublicIP value that will be the current IP.

Any help?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...