byoda Posted July 9, 2010 Share Posted July 9, 2010 All, I am writting a function that will pause the script and pop up a dialog box while the user makes a change to a remote computer. Once the user is finished configuring the remote computer, they should be able to click an unpause button to kill the dialog box and continue the script. I have a dialog created with a select/case to exit when the button is pushed. I have used exitloop and exit, but neither work. Am i going about this the wrong way? Thanks. Link to comment Share on other sites More sharing options...
sleepydvdr Posted July 9, 2010 Share Posted July 9, 2010 I think you need to look up GuiDelete in the help file. #include <ByteMe.au3> Link to comment Share on other sites More sharing options...
PsaltyDS Posted July 9, 2010 Share Posted July 9, 2010 Am i going about this the wrong way?We don't know what way you went. Post a short demo script and it should be easy to figure out your issue. As a bonus, in my experience, there's about a 75% chance of you suddenly seeing the problem and fixing it on your own while working up the demo script. Extracting the problem from the context of the rest of your script and working on it in isolation is a wonderful teaching/learning tool. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
byoda Posted July 9, 2010 Author Share Posted July 9, 2010 Very true and understood. Here it is. It completes Func1, then goes to the Pause function. The dialog appears, but when I press the completed button, the dialog does not disappear, but the script does move on to Func2. Thank you very much. Func1() Pause() Func Pause() GUICreate("FLASH", 250, 200 ) Opt("GUICoordMode", 1) GUICtrlCreateLabel("Please configure and press Completed", 40, 10, 90) $Completed = GUICtrlCreateButton("Completed", 20, 40, 90) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $Completed ExitLoop EndSelect WEnd EndFunc Func2() Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted July 9, 2010 Moderators Share Posted July 9, 2010 byoda, I think you need to look up GuiDelete in the help file.And I agree with him! M23 Func Pause() $hGUI = GUICreate("FLASH", 250, 200) Opt("GUICoordMode", 1) GUICtrlCreateLabel("Please configure and press Completed", 40, 10, 90) $Completed = GUICtrlCreateButton("Completed", 20, 40, 90) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $Completed GUIDelete($hGUI) ExitLoop EndSelect WEnd EndFunc ;==>Pause  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...
byoda Posted July 9, 2010 Author Share Posted July 9, 2010 So do I Just got it. Thanks for both of your help. Func1() Pause() Func Pause() GUICreate("FLASH", 250, 200 ) Opt("GUICoordMode", 1) GUICtrlCreateLabel("Please configure and press Completed", 40, 10, 90) $Completed = GUICtrlCreateButton("Completed", 20, 40, 90) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $Completed GUIDelete() ExitLoop EndSelect WEnd EndFunc Func2() Link to comment Share on other sites More sharing options...
PsaltyDS Posted July 9, 2010 Share Posted July 9, 2010 So sleepydvdr called it for you already; you just needed GuiDelete() right before ExitLoop. Another option is to use a standard MsgBox(): Global $f_Run = True Func1() Pause() If $f_Run Then Func2() Func Func1() ConsoleWrite("Debug: Func1()" & @LF) EndFunc ;==>Func1 Func Func2() ConsoleWrite("Debug: Func2()" & @LF) EndFunc ;==>Func2 Func Pause() If MsgBox(32 + 1, "FLASH", "Please configure application." & @CRLF & _ "Press OK if successful, or CANCEL if can't comply...") = 1 Then ConsoleWrite("Debug: Operator reports success" & @LF) Else $f_Run = False ConsoleWrite("Debug: Operator reports can't comply" & @LF) EndIf EndFunc ;==>Pause Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Thornhunt Posted July 9, 2010 Share Posted July 9, 2010 (edited) if im not wrong . doesnt msgbox() also pause the script ? just a stab in the dark wouldnt Func Pause() GUICreate("FLASH", 250, 200 ) Opt("GUICoordMode", 1) msgbox(1,"Please configure and Press 'Ok'".... (ect ect) EndFunc also work ? sorry if i am wrong //edit ........ DAMMIT SALTY i had to go to the loo and you reply. thunder killer *shakes fist* Edited July 9, 2010 by Thornhunt Budweiser + room = warm beerwarm beer + fridge = too long!warm beer + CO2 fire extinguisher = Perfect![quote]Protect the easly offended ... BAN EVERYTHING[/quote]^^ hmm works for me :D 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