MyEarth Posted May 30, 2013 Posted May 30, 2013 (edited) Hello, i need an help I need to check in a loop if a value change. I'll expalin better I have an inputbot with value = 10 I'll change the value to = 12 it's different to 10 so do func MyFunc() I'll change the value to = 11 it's different to 12 so do func MyFunc() In real temp because i need it a loop If i put GUICtrlRead in the While...WEnd is too much because check every time. How to store the old value in a variable and the see if it change? Thanks, tell me if i wasn't clear Edited May 30, 2013 by MyEarth
Solution UEZ Posted May 30, 2013 Solution Posted May 30, 2013 (edited) Something like this here? #include <GUIConstantsEx.au3> #include <EditConstants.au3> $iPrevious = 10 GUICreate("Test", 300, 200) $iInp = GUICtrlCreateInput($iPrevious, 20, 90, 30, 20, $ES_NUMBER) $iLbl = GUICtrlCreateLabel("Enter a number and press Return", 60, 92) $iBtn = GUICtrlCreateButton("X", 250, 150, 40, 40) GUISetState() Do Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $iBtn GUIDelete() Exit Case $iInp $iCurrent = GUICtrlRead($iInp) If $iCurrent <> $iPrevious Then $iPrevious = $iCurrent F() EndIf EndSwitch Until False Func F() MsgBox(0, "Function Call", "Function was called") Return 1 EndFuncBr,UEZ Edited May 30, 2013 by UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
MyEarth Posted May 30, 2013 Author Posted May 30, 2013 Not I don't know the value, can be 1000 or 1, so i can't make a Case for everyone. Thanks
UEZ Posted May 30, 2013 Posted May 30, 2013 I just update the code.Br,UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
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