AutoDEV Posted November 26, 2023 Share Posted November 26, 2023 (edited) Hello. I try to return, on home menu after clicking on F9, but with my script he close all My code :: Func _stop() $m = MsgBox(4, 'STOP', 'Leave ? ?') if $m == 6 Then Exit EndIf EndFunc Please how to stop a actual gui and not all ? Plz, THX Edited November 26, 2023 by AutoDEV Link to comment Share on other sites More sharing options...
Musashi Posted November 26, 2023 Share Posted November 26, 2023 3 hours ago, AutoDEV said: Please how to stop a actual gui and not all ? Your code snippet is not sufficient for a precise answer. In general, you exit a function with the RETURN command. EXIT terminates the entire script. "In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." Link to comment Share on other sites More sharing options...
Developers Jos Posted November 26, 2023 Developers Share Posted November 26, 2023 This is becoming a standard answer for you @AutoDEV: Post code that is valid and runnable when you want support! So, please for here on put in the effort to do so and only ask questions with complete information! Thanks SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
AutoDEV Posted November 26, 2023 Author Share Posted November 26, 2023 ok. I have make hotkey Func _PauseScript() $bPaused = True GUICtrlSetData($Button1, "Make PAUSE") If MsgBox(0, 'Pause', 'click ok for continue') = $IDOK Then $bPaused = False GUICtrlSetData($Button1,"MAKE ONE PAUSE") Return EndIf EndFunc HotKeySet("{F8}", "_PauseScript") But how make stop function ? Thanks Link to comment Share on other sites More sharing options...
Nine Posted November 26, 2023 Share Posted November 26, 2023 I guess you did not understand what @Jos just told you. Your code is incomplete, unrunable and your question is vague, unclear... “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
AutoDEV Posted November 26, 2023 Author Share Posted November 26, 2023 (edited) I have one app When i click on F10 i need close current GUIa and loop HotKeySet("{F10}", "_ExitScript") Func _ExitScript() $m = MsgBox(4, 'STOP', 'want stop GUI ?') if $m == 6 Then Exit ;exitloop not working EndIf EndFunc and exitloop not working because is not a loop, im lost. How to close loop ? TY Edited November 26, 2023 by AutoDEV Link to comment Share on other sites More sharing options...
Andreik Posted November 26, 2023 Share Posted November 26, 2023 Aren't you tired to ask stupid questions? Go through a basic AutoIt tutorial to get the basics because right now you are unable to understand basic programming. Xandy and Musashi 1 1 When the words fail... music speaks. Link to comment Share on other sites More sharing options...
Developers Jos Posted November 26, 2023 Developers Share Posted November 26, 2023 @AutoDEV, Please read my previous post again and make sure you conform to that request! Any question without the appropriate information or working script will simply be removed. Hope that I am clear now because I would hate to resort to this rather silly approach of removing post. Thanks SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
AutoDEV Posted November 26, 2023 Author Share Posted November 26, 2023 (edited) OK im sorry, im not one troll, and my questions is hard for me. I make more easy: How to stop a loop when i press F10. Exemple code 1 : HotKeySet("{F10}", "_ExitLoop") Global $bLoop = True While $bLoop Sleep(100) WEnd MsgBox(4096, "Exit Loop", "Complete") Func _ExitLoop() $bLoop = False EndFunc Exemple 2 : HotKeySet("{F11}", "_ExitLoop") Global $exitloop = False While 1 If $exitloop = True Then MsgBox( 0 , '' , '$exitloop = '& $exitloop &' , Will exit the loop now.' ) $exitloop = NOT $exitloop ExitLoop EndIf WEnd Func _ExitLoop() $exitloop = True EndFunc Probllem with the script is im blocked in infinite loop. and projet is in pause I can't make best description for,my problem Jos and Andreik Thank you to help me Edited November 27, 2023 by AutoDEV Link to comment Share on other sites More sharing options...
argumentum Posted November 27, 2023 Share Posted November 27, 2023 (edited) 38 minutes ago, AutoDEV said: . and projet is in pause Global $bLoop = True If HotKeySet("{F10}", "_ExitLoop") Then ; https://www.autoitscript.com/autoit3/docs/functions/HotKeySet.htm MainLoop() MsgBox(4096, "Exit Loop", "Complete") Else MsgBox(4096, "No can do", "That key did not work, bye.") EndIf Func MainLoop() While $bLoop Sleep(100) WEnd EndFunc Func _ExitLoop() $bLoop = False EndFunc Read the help file. There you will find all your answers. Read the forums and you're gonna find over 180,000 answers of questions mostly, of those that did not read the help file. PS: .. write your code thinking that everything is going to fail. That way you will code with "unexpected results" in mind, making you a better person programmer Edited November 27, 2023 by argumentum spelling Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. 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