mr-es335 Posted November 4, 2023 Share Posted November 4, 2023 (edited) Good day, Though I am having "fun" with this, I anunable to get this to work... I need to put this... expandcollapse popup; ----------------------------------------------- #include <AutoItConstants.au3> #include <FileConstants.au3> ; ----------------------------------------------- Call_Intro() Create_Main_Folder() Create_Sub_Folders1() Create_Sub_Folders2() Call_Outro() ; ----------------------------------------------- Func Call_Intro() SplashTextOn("NOTICE!!", "Create Session_Master folders...", 450, 50, -1, -1) Sleep(2000) EndFunc ; ----------------------------------------------- Func Create_Main_Folder() Local $_main_folder="E:\Master_Backup\Session_Master" ; ------ DirCreate($_main_folder) EndFunc ; ----------------------------------------------- Func Create_Sub_Folders1() Local $_main_folder="E:\Master_Backup\Session_Master" Local $_perf_folder="E:\Master_Backup\Session_Master\Show" Local $_scenes_folder="E:\Master_Backup\Session_Master\Scenes" Local $_su_folder="E:\Master_Backup\Session_Master\Session_Undo" ; ------ FileChangeDir ($_main_folder) DirCreate($_perf_folder) DirCreate($_scenes_folder) DirCreate($_su_folder) EndFunc ; ----------------------------------------------- Func Create_Sub_Folders2() Local $_perf_folder="E:\Master_Backup\Session_Master\Show" Local $_sd_folder="E:\Master_Backup\Session_Master\Show\Session_Data" Local $_su_folder="E:\Master_Backup\Session_Master\Show\Session_Undo" ; ------ FileChangeDir ($_perf_folder) DirCreate($_sd_folder) DirCreate($_su_folder) EndFunc ; ----------------------------------------------- Func Call_Outro() SplashTextOn("NOTICE!!", "Create Session_Master folders completed...", 450, 50, -1, -1) Sleep(2000) EndFunc ; ----------------------------------------------- ...into this... #include <AutoItConstants.au3> #include <FileConstants.au3> #include <FontConstants.au3> #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> ; ----------------------------------------------- Local $hGUI=GUICreate("Working Menu", 345, 65) GUISetFont(12, $FW_BOLD, $GUI_FONTNORMAL, "Calibri") ; ----------------- Local $Create_SM_Folder=GUICtrlCreateButton("Create_SM_Folder", 20, 20, 150, 25) Local $Exit=GUICtrlCreateButton("Exit", 190, 20, 150, 25) ; ----------------------------------------------- GUISetState(@SW_SHOW, $hGUI) ; ----------------------------------------------- While 1 Switch GUIGetMsg() $Case $GUI_EVENT_CLOSE, $Exit ExitLoop $Case Create_SM_Folder Create_SM_Folder() EndSwitch WEnd ; ----------------------------------------------- Func Create_SM_Folder() $MyBox=MsgBox($MB_SYSTEMMODAL, "NOTICE?", "Not deployed yet...") ; Insert code here] EndFunc ; ----------------------------------------------- Note: Both DO work on their own...but NOT together. What is it that I am doing wrong? Sort of at a complete loss on how to do this!! Any assistance would be appreciated! Someone had provided this... ; ----------------------------------------------- #include <AutoItConstants.au3> #include <MsgBoxConstants.au3> ; ----------------------------------------------- MainFunction() ; Func MainFunction() SubFunction() MsgBox(0, "end:", "") EndFunc ;==>MainFunction ; Func SubFunction() MsgBox(1024, "Test", "This is a test!") EndFunc ;==>SubFunction ; ----------------------------------------------- Thanks! Edited November 5, 2023 by mr-es335 mr-es335 Sentinel Music Studios Link to comment Share on other sites More sharing options...
Nine Posted November 5, 2023 Share Posted November 5, 2023 Your missing $ before Case Create_SM_Folder mr-es335 1 “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...
mr-es335 Posted November 5, 2023 Author Share Posted November 5, 2023 Nine, Ok! Fixed...but may I ask how does this resolve my current issue? mr-es335 Sentinel Music Studios Link to comment Share on other sites More sharing options...
Dan_555 Posted November 5, 2023 Share Posted November 5, 2023 (edited) expandcollapse popup#include <AutoItConstants.au3> #include <FileConstants.au3> #include <FontConstants.au3> #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> ; ----------------------------------------------- Local $hGUI = GUICreate("Working Menu", 345, 65) GUISetFont(12, $FW_BOLD, $GUI_FONTNORMAL, "Calibri") ; ----------------- Local $Create_SM_Folder = GUICtrlCreateButton("Create_SM_Folder", 20, 20, 150, 25) Local $Exit = GUICtrlCreateButton("Exit", 190, 20, 150, 25) ; ----------------------------------------------- GUISetState(@SW_SHOW, $hGUI) ; ----------------------------------------------- While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $Exit ExitLoop Case Create_SM_Folder Create_SM_Folder() EndSwitch WEnd ; ----------------------------------------------- Func Create_SM_Folder() Call_Intro() Create_Main_Folder() Create_Sub_Folders1() Create_Sub_Folders2() Call_Outro() EndFunc ;==>Create_SM_Folder Func Call_Intro() SplashTextOn("NOTICE!!", "Create Session_Master folders...", 450, 50, -1, -1) Sleep(2000) EndFunc ;==>Call_Intro ; ----------------------------------------------- Func Create_Main_Folder() Local $_main_folder = "E:\Master_Backup\Session_Master" ; ------ DirCreate($_main_folder) EndFunc ;==>Create_Main_Folder ; ----------------------------------------------- Func Create_Sub_Folders1() Local $_main_folder = "E:\Master_Backup\Session_Master" Local $_perf_folder = "E:\Master_Backup\Session_Master\Show" Local $_scenes_folder = "E:\Master_Backup\Session_Master\Scenes" Local $_su_folder = "E:\Master_Backup\Session_Master\Session_Undo" ; ------ FileChangeDir($_main_folder) DirCreate($_perf_folder) DirCreate($_scenes_folder) DirCreate($_su_folder) EndFunc ;==>Create_Sub_Folders1 ; ----------------------------------------------- Func Create_Sub_Folders2() Local $_perf_folder = "E:\Master_Backup\Session_Master\Show" Local $_sd_folder = "E:\Master_Backup\Session_Master\Show\Session_Data" Local $_su_folder = "E:\Master_Backup\Session_Master\Show\Session_Undo" ; ------ FileChangeDir($_perf_folder) DirCreate($_sd_folder) DirCreate($_su_folder) EndFunc ;==>Create_Sub_Folders2 ; ----------------------------------------------- Func Call_Outro() SplashTextOn("NOTICE!!", "Create Session_Master folders completed...", 450, 50, -1, -1) Sleep(2000) EndFunc ;==>Call_Outro ; ----------------------------------------------- Edited November 5, 2023 by Dan_555 Some of my script sourcecode Link to comment Share on other sites More sharing options...
mr-es335 Posted November 5, 2023 Author Share Posted November 5, 2023 (edited) Dan_555, Thanks for this...very much appreciated! As a side-note, I employ Excel to show comparisons - as I really want to understand what is the possible solution is to a given scenario. As noted, "What I see accomplished here is to place the Function calls within the Main Function! This is so obvious - it is almost scary!!" Thanks again, Dan-555...appreciated. PS: I do notice that you, as well as the examples provided in the HelpFile, have [;==>Call_Intro] at the close of each Function. I gather that this addition is provided simply for clarification purposes. Correct? Edited November 5, 2023 by mr-es335 mr-es335 Sentinel Music Studios Link to comment Share on other sites More sharing options...
mr-es335 Posted November 5, 2023 Author Share Posted November 5, 2023 (edited) Dan_555, The updates does not appear to be working! I have simplified the script based on your recommendations... expandcollapse popup; ----------------------------------------------- #include <AutoItConstants.au3> #include <FileConstants.au3> #include <FontConstants.au3> #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> ; ----------------------------------------------- Local $hGUI = GUICreate("Working Menu", 345, 65) GUISetFont(12, $FW_BOLD, $GUI_FONTNORMAL, "Calibri") ; ----------------- Local $Create_SM_Folder = GUICtrlCreateButton("Create_SM_Folder", 20, 20, 150, 25) Local $Exit = GUICtrlCreateButton("Exit", 190, 20, 150, 25) ; ----------------------------------------------- GUISetState(@SW_SHOW, $hGUI) ; ----------------------------------------------- While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $Exit ExitLoop Case $Create_SM_Folder Create_SM_Folder() EndSwitch WEnd ; ----------------------------------------------- Func Create_SM_Folder() Call_Intro() Create_Main_Folder() Create_Sub_Folders1() Create_Sub_Folders2() Call_Outro() EndFunc ;==>Create_SM_Folder ; ----------------------------------------------- Func Call_Intro() MsgBox($MB_SYSTEMMODAL, "", "Inside Call_Intro()") EndFunc ;==>Call_Intro ; ----------------------------------------------- Func Create_Main_Folder() MsgBox($MB_SYSTEMMODAL, "", "Inside Create_Main_Folder()") EndFunc ;==>Create_Main_Folder ; ----------------------------------------------- Func Create_Sub_Folders1() MsgBox($MB_SYSTEMMODAL, "", "Inside Create_Sub_Folders1()") EndFunc ;==>Create_Sub_Folders1 ; ----------------------------------------------- Func Create_Sub_Folders2() MsgBox($MB_SYSTEMMODAL, "", "Inside Create_Sub_Folders2()") EndFunc ;==>Create_Sub_Folders2 ; ----------------------------------------------- Func Call_Outro() MsgBox($MB_SYSTEMMODAL, "", "Inside Call_Outro()") EndFunc ;==>Call_Outro ; ----------------------------------------------- Edited November 5, 2023 by mr-es335 mr-es335 Sentinel Music Studios Link to comment Share on other sites More sharing options...
Solution Dan_555 Posted November 5, 2023 Solution Share Posted November 5, 2023 (edited) @Nine mentioned it earlier: There is a missing $. It should be: Case $Create_SM_Folder I couldn't/wouldn't test the code, because the E: is a CD rom drive on my pc ... Edited November 5, 2023 by Dan_555 Some of my script sourcecode Link to comment Share on other sites More sharing options...
mr-es335 Posted November 5, 2023 Author Share Posted November 5, 2023 (edited) Dan_555, Totally missed that one...thanks!!! • It is not that I use CD's...I used multiple HDD's in my main system. Edited November 5, 2023 by mr-es335 mr-es335 Sentinel Music Studios Link to comment Share on other sites More sharing options...
mr-es335 Posted November 5, 2023 Author Share Posted November 5, 2023 Good day, Just for curiosity, any idea why the script works with the first [SplashTextOn]...but not the second? expandcollapse popup; ----------------------------------------------- #include <AutoItConstants.au3> #include <FileConstants.au3> #include <FontConstants.au3> #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> ; ----------------------------------------------- Local $hGUI=GUICreate("Working Menu", 345, 65) GUISetFont(12, $FW_BOLD, $GUI_FONTNORMAL, "Calibri") ; ----------------- Local $Create_SM_Folder=GUICtrlCreateButton("Create_SM_Folder", 20, 20, 150, 25) Local $Exit=GUICtrlCreateButton("Exit", 190, 20, 150, 25) ; ----------------------------------------------- GUISetState(@SW_SHOW, $hGUI) ; ----------------------------------------------- While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $Exit ExitLoop Case $Create_SM_Folder Create_SM_Folder() EndSwitch WEnd ; ----------------------------------------------- Func Create_SM_Folder() Call_Intro() Call_Outro() EndFunc ;==>Create_SM_Folder ; ----------------------------------------------- Func Call_Intro() ;MsgBox($MB_SYSTEMMODAL, "NOTICE!!", "Create Session_Master folders...", 3) SplashTextOn("NOTICE!!", "Create Session_Master folders...", 450, 50, -1, -1) Sleep(2000) EndFunc ;==>Call_Intro ; ----------------------------------------------- Func Call_Outro() ;MsgBox($MB_SYSTEMMODAL, "NOTICE!!", "Create Session_Master folders completed...", 1) SplashTextOn("NOTICE!!", "Create Session_Master folders completed...", 450, 50, -1, -1) Sleep(2000) EndFunc ;==>Call_Outro ; ----------------------------------------------- It would appear that the last Function "gets hung-up" somehow! • Both MsgBox's work however. mr-es335 Sentinel Music Studios Link to comment Share on other sites More sharing options...
Dan_555 Posted November 6, 2023 Share Posted November 6, 2023 it works with both. Add SplashOff ( ) after each Sleep(2000) Some of my script sourcecode Link to comment Share on other sites More sharing options...
mr-es335 Posted November 6, 2023 Author Share Posted November 6, 2023 Dan_555, Thanks for this...very much appreciated Rather that "not being able to assume the obvious"...and an apparent disinclination to "...read the sufferin' HelpFile", I do tend to refer such episodes as "cranial deprivation" [which tends to sound more eloquent that saying "I am stupid!" Anyhow...thanks again, Dan! mr-es335 Sentinel Music Studios 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