will88 Posted January 26, 2009 Share Posted January 26, 2009 (edited) I'm sure this is a simple fix and I feel really dumb for posting this <.< but after messing around with it for 20min I can't seem to get it to work. GUICreate("Enter User & Pass",230,90) GUICtrlCreateLabel("Username:",15,5) $User=GUICtrlCreateInput("",70,0,100,20) GUICtrlCreateLabel("Password:",16,35) $Pass=GUICtrlCreateInput("",70,32,100,20) GUICtrlCreateLabel("Password:",16,65) $Pass2=GUICtrlCreateInput("",70,62,100,20) $DoneButton=GUICtrlCreateButton("Done",180,33) GUISetState() While 1 $msg = GUIGetMsg() If $msg = -3 Then ExitLoop If $msg = $DoneButton Then $Username=GUICtrlRead($User) $Password=GUICtrlRead($Pass) $Password2=GUICtrlRead($Pass2) If Not $Password = $Password2 Then MsgBox(0,"Mismatch","The passwords do not match") EndIf EndIf Wend for the some reason the above code won't work, if I take out the "Not" then the message box goes off. so $Password does = $Password2 Username: a Password: b Password: b Edited January 26, 2009 by will88 Password-Keeper Link to comment Share on other sites More sharing options...
Developers Jos Posted January 26, 2009 Developers Share Posted January 26, 2009 Try: If Not ($Password == $Password2) Then Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
KaFu Posted January 26, 2009 Share Posted January 26, 2009 GUICreate("Enter User & Pass", 230, 90) GUICtrlCreateLabel("Username:", 15, 5) $User = GUICtrlCreateInput("", 70, 0, 100, 20) GUICtrlCreateLabel("Password:", 16, 35) $Pass = GUICtrlCreateInput("", 70, 32, 100, 20) GUICtrlCreateLabel("Password:", 16, 65) $Pass2 = GUICtrlCreateInput("", 70, 62, 100, 20) $DoneButton = GUICtrlCreateButton("Done", 180, 33) GUISetState() While 1 $msg = GUIGetMsg() If $msg = -3 Then ExitLoop If $msg = $DoneButton Then $Username = GUICtrlRead($User) $Password = GUICtrlRead($Pass) $Password2 = GUICtrlRead($Pass2) If $Password <> $Password2 Then MsgBox(0, "Mismatch", "The passwords do not match") Else MsgBox(0, "Match", "The passwords do match") EndIf EndIf WEnd OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
will88 Posted January 26, 2009 Author Share Posted January 26, 2009 Try: If Not ($Password == $Password2) Then Jos Thanks! Password-Keeper Link to comment Share on other sites More sharing options...
Developers Jos Posted January 26, 2009 Developers Share Posted January 26, 2009 (edited) Understand the difference with your code and where yours went wrong? Edited January 26, 2009 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
will88 Posted January 26, 2009 Author Share Posted January 26, 2009 (edited) Understand the difference with your code and where yours went wrong?Not really I've never seen the IF with ( ) in autoit and I tried == instead of = before but that didn't work ethier. Edited January 26, 2009 by will88 Password-Keeper Link to comment Share on other sites More sharing options...
Developers Jos Posted January 26, 2009 Developers Share Posted January 26, 2009 (edited) Its simple ones you understand:ThisIf Not $Password = $Password2 ThenIs resolved from left to right... thus first step is to resolve "Not $Password"This will resolve to False.After that you compare "False = $password2"so your statement is resolved like coding it as:If (Not $Password) = $Password2 ThenThe == just makes it compare Case-sensitive which is something you want for passwords. Edited January 26, 2009 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. 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