mr-es335 Posted Monday at 10:44 PM Posted Monday at 10:44 PM (edited) Good day, How does one exit from the OnCopy() function? Spoiler expandcollapse popup; ----------------------------------------------- #RequireAdmin ; ----------------------------------------------- #include <Constants.au3> #include <GUIConstantsEx.au3> ; ----------------------------------------------- Opt("GUIOnEventMode", 1) Opt("MustDeclareVars", 1) ; ----------------------------------------------- Global $g_idButton_Exit ; ----------------------------------------------- _Main() ; ----------------------------------------------- Func _Main() GUICreate("", 130, 40) ; --------------------- Local $idButton_Yes = GUICtrlCreateButton("Copy", 10, 10, 50, 20) GUICtrlSetOnEvent($idButton_Yes, "OnCopy") ; --------------------- $g_idButton_Exit = GUICtrlCreateButton("Exit", 70, 10, 50, 20) GUICtrlSetOnEvent($g_idButton_Exit, "OnExit") GUISetOnEvent($GUI_EVENT_CLOSE, "OnExit") ; ----------------------------------------------- GUISetState() ; ----------------------------------------------- While 1 Sleep(1000) WEnd EndFunc ;==>_Main ; ----------------------------------------------- Func OnCopy() Local $sFilePath = "E:\Desktop\Working\Tests\ReadIni\P7.ini" Local $aArray = IniReadSection($sFilePath, "Scene Data") ConsoleWrite(@error & @CRLF) If Not @error Then For $i = 1 To $aArray[0][0] MsgBox($MB_OKCANCEL, "", $aArray[$i][1] & "...will be copied to the Clipboard....continue...") ConsoleWrite(@error & @CRLF) ClipPut($aArray[$i][1]) Next EndIf EndFunc ;==>OnCopy ; ----------------------------------------------- Func OnExit() If @GUI_CtrlId = $g_idButton_Exit Then Exit EndIf EndFunc ;==>OnExit ; ----------------------------------------------- Any assistance in this matter would be greatly appreciated! Edited Monday at 10:46 PM by mr-es335 mr-es335 Sentinel Music Studios
ioa747 Posted yesterday at 12:07 AM Posted yesterday at 12:07 AM 1 hour ago, mr-es335 said: How does one exit from the OnCopy() function? the issue here is not how you exit, but what you want to do. Otherwise I would tell you to press OK or Cancel until the keys from the ini file are finished, and then it will exit I know that I know nothing
mr-es335 Posted yesterday at 12:52 AM Author Posted yesterday at 12:52 AM ioa747, I want to be able to exit the loop by sleeting "Cancel" - rather than having to wait until the keys from the ini file are finished. PS: I hope that I have stated myself correctly? mr-es335 Sentinel Music Studios
Solution ioa747 Posted yesterday at 12:56 AM Solution Posted yesterday at 12:56 AM If MsgBox($MB_OKCANCEL, "", $aArray[$i][1] & "...will be copied to the Clipboard....continue...") = $IDCANCEL Then ExitLoop mr-es335 1 I know that I know nothing
mr-es335 Posted 23 hours ago Author Posted 23 hours ago ioa747, Before I comment, this comment has to do with you personally, but.... 1) After some 3-4 hours of trying various "ways-and-means", I then observe what you have done and ask "So simple...yet completely beyond my pervue!" 2) Thus, what I would love to know is how do you "apparently" - come up with the solutions that you do? mr-es335 Sentinel Music Studios
ioa747 Posted 19 hours ago Posted 19 hours ago 3 hours ago, mr-es335 said: Thus, what I would love to know is how do you "apparently" - come up with the solutions that you do? what can I say? it's like a crossword puzzle, the more you solve, the easier it becomes. You don't have to solve it all, not even if you write a word wrong, because as you solve, you will find it in front of you, and you will correct it mr-es335 1 I know that I know nothing
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