=sinister= Posted August 27, 2006 Share Posted August 27, 2006 (edited) $Read = GUICtrlRead($Password) $GetPasswords = GetPasswords() If $Read = $GetPasswords Then MsgBox(0, "test", "good") Else ;Bad EndIf Func GetPasswords() $Pass01 = "lala" $Pass02 = "lolo" $Pass03 = "fofo" $Pass04 = "gogo" $Pass05 = "momo" $GetPass = _ArrayCreate($Pass01, $Pass02, $Pass03, $Pass04, $Pass05) Return $GetPass EndFunc Why doesn't this work? $Password is an input box. Edited August 27, 2006 by =sinister= Link to comment Share on other sites More sharing options...
Danny35d Posted August 27, 2006 Share Posted August 27, 2006 May this if statement work better for youIf StringInStr($GetPasswords, $Read) <> 0 Then AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line Link to comment Share on other sites More sharing options...
=sinister= Posted August 27, 2006 Author Share Posted August 27, 2006 Still didn't work =( Link to comment Share on other sites More sharing options...
Helge Posted August 27, 2006 Share Posted August 27, 2006 $Read is a string and $GetPasswords is an array so comparing those wouldn't work. You have to compare $Read with all the elements in the array..either "manually" or by using _ArraySearch. Link to comment Share on other sites More sharing options...
=sinister= Posted August 27, 2006 Author Share Posted August 27, 2006 Ok, so I got this: $Read = GUICtrlRead($Password) ;<--Passwords Dim $Pass[6] $Pass[0] = "String0" $Pass[1] = "String1" $Pass[2] = "String2" $Pass[3] = "String3" $Pass[4] = "String4" $Pass[5] = "String5" ;<--End Passwords $Pos = _ArraySearch ($Pass, $Password) If $Pos = -1 Then ;Error Else MsgBox(0, "test", "good") EndIf Still doesn't work? Link to comment Share on other sites More sharing options...
Danny35d Posted August 27, 2006 Share Posted August 27, 2006 #include <Array.au3> $Read = GUICtrlRead($Password) $GetPasswords = GetPasswords() If _ArraySearch($GetPasswords, $Read) <> -1 Then MsgBox(0, "test", "good") Else MsgBox(0, "test", "bad") EndIf Func GetPasswords() $Pass01 = "lala" $Pass02 = "lolo" $Pass03 = "fofo" $Pass04 = "gogo" $Pass05 = "momo" $GetPass = _ArrayCreate($Pass01, $Pass02, $Pass03, $Pass04, $Pass05) Return $GetPass EndFuncThis work now, I didn't notice the array on my first post. AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line Link to comment Share on other sites More sharing options...
=sinister= Posted August 27, 2006 Author Share Posted August 27, 2006 Thanks! It works perfectly! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now