Bert Posted January 6, 2006 Posted January 6, 2006 I'm working with a timer that I need to put a alarm on it. I can get the alarm to work, however I need to have it so the user can only enter in a certain range. (1 to 8 hours) I tried this, but it didn't work. if $msg = $TButton_[$xk] And GUICtrlRead($InputA_[$xk]) < 1 And GUICtrlRead($InputA_[$xk]) > 8 Then msgbox(0, "Error!", "You must enter in hours between 1 and 8") If $msg = $TButton_[$xk] And GUICtrlRead($Input_[$xk]) > "" Then GUICtrlSetState($TButton_[$xk], $GUI_DISABLE) GUICtrlSetState($Input_[$xk], $GUI_DISABLE) $TimerActive_[$xk] = 1 $Timer_[$xk] = TimerInit() elseif $msg = $TButton_[$xk] then MsgBox(64, "User Error", "Please Type in a Ticket Number ", 3) The Vollatran project My blog: http://www.vollysinterestingshit.com/
Moderators SmOke_N Posted January 6, 2006 Moderators Posted January 6, 2006 Didn't we already do this for you _TimeToTicks? Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Bert Posted January 6, 2006 Author Posted January 6, 2006 this is something a little different. I added a field in the upper right corner that allows for the user to pick how many hours they want to clock to run before the alarm goes off. All I need is a way so if they enter >8 or <1 they would get a error message. I can post the entire code if you needed it. The Vollatran project My blog: http://www.vollysinterestingshit.com/
Bert Posted January 6, 2006 Author Posted January 6, 2006 I just figured it out. $hrc = GUICtrlRead($InputA_[$xk]) if $msg = $TButton_[$xk] And $hrc < 1 Then msgbox(0, "Error!", "You must enter in hours between 1 and 8") if $msg = $TButton_[$xk] And $hrc > 8 Then msgbox(0, "Error!", "You must enter in hours between 1 and 8") If $msg = $TButton_[$xk] And GUICtrlRead($Input_[$xk]) > "" Then GUICtrlSetState($TButton_[$xk], $GUI_DISABLE) GUICtrlSetState($Input_[$xk], $GUI_DISABLE) $TimerActive_[$xk] = 1 $Timer_[$xk] = TimerInit() elseif $msg = $TButton_[$xk] then MsgBox(64, "User Error", "Please Type in a Ticket Number ", 3) The Vollatran project My blog: http://www.vollysinterestingshit.com/
Valuater Posted January 6, 2006 Posted January 6, 2006 (edited) maybe this If $msg = $TButton_[$xk] Then $hrc = GUICtrlRead($InputA_[$xk]) If $hrc < 1 Or $hrc > 8 Then MsgBox(0, "Error!", "You must enter in hours between 1 and 8") ;Return for a function or ContinueLoop for While/Wend EndIf If GUICtrlRead($Input_[$xk]) > "" Then GUICtrlSetState($TButton_[$xk], $GUI_DISABLE) GUICtrlSetState($Input_[$xk], $GUI_DISABLE) $TimerActive_[$xk] = 1 $Timer_[$xk] = TimerInit() Else MsgBox(64, "User Error", "Please Type in a Ticket Number ", 3) EndIf EndIf 8) Edited January 6, 2006 by Valuater
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