testingtest Posted September 16, 2007 Posted September 16, 2007 I was wondering If I had a script that did this GUICreate("test", 261.5, 275) $Key = GUICtrlCreateInput("" , 0, 255, 230, 21) $Gen = GUICtrlCreateButton("Gen", 232, 255, 30, 21, 0) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Gen _test() EndSwitch WEnd Func _Test() $Keys[1] = "line 1" $Keys[2] = "line 2" $i = 0+1 GUICtrlSetData($Key , "") GUICtrlSetData($Key , $Keys[$i] , "Error") EndFunc how can I make it remember what key it did already so it will move on to the next so if the first key is done ($keys[1] = "line 1") It will remember that until its push again then it will clear input and put the second key I tried messing with variables that told it what ones were done but didn't work well
Paulie Posted September 16, 2007 Posted September 16, 2007 (edited) GUICreate("test", 261.5, 275) $Key = GUICtrlCreateInput("" , 0, 255, 230, 21) $Gen = GUICtrlCreateButton("Gen", 232, 255, 30, 21, 0) GUISetState(@SW_SHOW) Global $i = 0 While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Gen _test() EndSwitch WEnd Func _Test() $Keys[1] = "line 1" $Keys[2] = "line 2" $i +=1 GUICtrlSetData($Key , "") GUICtrlSetData($Key , $Keys[$i] , "Error") EndFunc Edited September 16, 2007 by Paulie
testingtest Posted September 16, 2007 Author Posted September 16, 2007 GUICreate("test", 261.5, 275) $Key = GUICtrlCreateInput("" , 0, 255, 230, 21) $Gen = GUICtrlCreateButton("Gen", 232, 255, 30, 21, 0) GUISetState(@SW_SHOW) Global $i = 0 While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Gen _test() EndSwitch WEnd Func _Test() $Keys[1] = "line 1" $Keys[2] = "line 2" $i +=1 GUICtrlSetData($Key , "") GUICtrlSetData($Key , $Keys[$i] , "Error") EndFunc thanks would $i = 1+ also work?
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