sbrady Posted December 14, 2012 Share Posted December 14, 2012 what does it mean when the "Tools>stop executing" menu item is hightlighted. Does it mean that something is still running in your script. I have a GUI with 6 Tabs and up to 6 buttons on any tab. Some buttons are not fully programmed, yet they do something simple as opening a Message Box that says "You pushed button 4". Shouldnt the script stop after that simple command. What is going on that makes the "Tools>stop executing" menu item active. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 14, 2012 Moderators Share Posted December 14, 2012 sbrady,If the <Tools - Stop Executing> menu item in SciTE is highlighted (highlit?) then your script is still running. The script will only stop if it comes across an "Exit" command or if the script flow ceases - this shows you what happens:#include <GUIConstantsEx.au3> $hGUI = GUICreate("Test", 500, 500) $cButton_1 = GUICtrlCreateButton("One", 10, 10, 80, 30) $cButton_2 = GUICtrlCreateButton("Two", 10, 110, 80, 30) $cButton_3 = GUICtrlCreateButton("Three", 10, 210, 80, 30) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ; Exit the script directly Exit Case $cButton_1 MsgBox(0, "Button 1 Pressed", "This will exit because it is followed by 'Exit'") ; Exit the script directly Exit Case $cButton_2 MsgBox(0, "Button 2 Pressed", "This will exit because the script flow stops") ; Break out of the While...WEnd loop ExitLoop Case $cButton_3 MsgBox(0, "Button 3 Pressed", "This will NOT exit because it just re-enters the loop") ; The script continues in the loop waiting for the next event EndSwitch WEnd ; Button 2 ends up here and the script exits as the script flow ceasesAll clear? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
sbrady Posted December 14, 2012 Author Share Posted December 14, 2012 when I insert the EXIT command, the whole GUI disappears............ Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 14, 2012 Moderators Share Posted December 14, 2012 sbrady,That is what will happen when the script stops. they do something simple as opening a Message Box that says "You pushed button 4". Shouldnt the script stop after that simple commandWhat do you want to happen after the MsgBox is closed? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
sbrady Posted December 14, 2012 Author Share Posted December 14, 2012 I would expect the script to be in a state of doing nothing. I dont understand why the MsgBox command makes the script wait for something else to happen. When I make a directory, its OK, when I open a folder, its OK, why is this making the script seem like its waiting for more. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 14, 2012 Moderators Share Posted December 14, 2012 sbrady,The script is always doing something until it exits so the menu item remains highlighted. At a absolute minimum it is staying active to look for the next event - that is why we always need some form of loop (usually a While...WEnd loop enclosing a GUIGetMsg or a Sleep command) within the script. Otherwise we get to the end of the script flow and it just stops - as you saw from the above example. The script pauses when a MsgBox appears because the MsgBox is created by a call to the Windows API. This is a blocking call and the script waits to see what it gets as a return value when the MsgBox is closed. If you want to have the script continue and ignore any action the user takes then you might want to look at Yashied's NotifyBox UDF as an alternative. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area 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