Didonet Posted September 11, 2007 Share Posted September 11, 2007 I'm making one form and I want to check are the filled This is my script for now While 1 If $username <> "" or $password <> "" Then RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\CTLogin", "uname", "REG_SZ", encrypt(1, $username)) RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\CTLogin", "passwd", "REG_SZ", encrypt(1, $password)) ExitLoop EndIf If $username = "" or $password = "" Then MsgBox(0, "Info", "Please enter username and password!") EndIf WEnd But if the user or pass are empty the message shows up and it don't want to hide... how to hide the message and start again the While? Link to comment Share on other sites More sharing options...
dbzfanatic Posted September 11, 2007 Share Posted September 11, 2007 (edited) Use a loop. While 1 Do If $username = "" or $password = "" Then MsgBox(0, "Info", "Please enter username and password!") EndIf Until $username <> "" And $password <> "" RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\CTLogin", "uname", "REG_SZ", encrypt(1, $username)) RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\CTLogin", "passwd", "REG_SZ", encrypt(1, $password)) ExitLoop WEnd and I cleaned up your code a bit too. Edited September 11, 2007 by dbzfanatic Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote] Link to comment Share on other sites More sharing options...
Didonet Posted September 11, 2007 Author Share Posted September 11, 2007 No, the msg is still looping... Link to comment Share on other sites More sharing options...
Danny35d Posted September 11, 2007 Share Posted September 11, 2007 No, the msg is still looping...You need to add the inputbox asking for username and password inside the While loop, so when the username or password is blank you have the chance the reenter username and password again. AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line Link to comment Share on other sites More sharing options...
dbzfanatic Posted September 11, 2007 Share Posted September 11, 2007 (edited) lol wow i need sleep, i did something like that not more than 3 weeks ago and did the inputbox thing and everything...he's right, just do something like While 1 do if $username = "" then $username = Inputbox("Username", "Input the username: ") endif until $username <> "" do if $password = "" then $password = Inputbox("Password", "Input the password: ", "", "*") endif until $password <> "" RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\CTLogin", "uname", "REG_SZ", encrypt(1, $username)) RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\CTLogin", "passwd", "REG_SZ", encrypt(1, $password)) ExitLoop WEnd something like that Edited September 11, 2007 by dbzfanatic Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote] 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