blumi Posted June 17, 2021 Posted June 17, 2021 I want to make a small script, no GUI, just a script with some buttons for abort, retry and continue. (msgbox, 70) For example the script should check if a @MIN value is reached or not. If it is reached, then go on and do this and that... If not the retry button should be pressed again to check if reached or not. I am not sure how to handle the loop and the botton (msgbox, 70) together. Tried to search it, but found only GUI solutions. Thank you
Solution Luke94 Posted June 17, 2021 Solution Posted June 17, 2021 (edited) I don't quite understand the full ins and outs of your script but is this of any help? #include <MsgBoxConstants.au3> Global $g_iInteger = 0 Global $g_iMsgBox While 1 If $g_iInteger >= @MIN Then _DoSomething() $g_iInteger = 0 Else $g_iMsgBox = MsgBox($MB_CANCELTRYCONTINUE, @ScriptName, 'Integer = ' & $g_iInteger & ', @MIN = ' & @MIN & '. What should I do?') Switch $g_iMsgBox Case $IDCANCEL ExitLoop Case $IDRETRY ContinueLoop Case $IDCONTINUE _DoSomething() ; I assume by continue you'd want to execute the code? $g_iInteger = 0 ; Should you reset the counter? EndSwitch $g_iInteger += 1 EndIf WEnd Func _DoSomething() MsgBox(($MB_OK + $MB_ICONINFORMATION), @ScriptName, 'Integer = ' & $g_iInteger & ', @MIN = ' & @MIN) EndFunc Edited June 17, 2021 by Luke94
blumi Posted June 17, 2021 Author Posted June 17, 2021 Yeah, that looks great, that's all I need to go on. Thanks for this fast help.
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