mr-es335 Posted 2 hours ago Share Posted 2 hours ago (edited) Good day, In a similar manner as that of a previous posting entitled, "FileSelectFolder Issues", I am having a similar issue here...though possibly...in reverse!? Here is the script: expandcollapse popup; ----------------------------------------------- #include <MsgBoxConstants.au3> ; ----------------------------------------------- Opt("MustDeclareVars", 1) ; ----------------------------------------------- Global $g_SetName = "" ; ----------------------------------------------- _EnterSetName() _DoesFolderExist() ; ----------------------------------------------- Func _EnterSetName() $g_SetName = InputBox("Notice!", "Enter the Type_# Set_Name...", "", " M", 200, 130) ConsoleWrite("1st: $g_SetName= " & $g_SetName & @CRLF) ; ----------------- If @error Then MsgBox($MB_ICONWARNING, "Notice!", "The operation was cancelled. Exiting!") Exit Else _DoesFolderExist() EndIf EndFunc ;==>_EnterSetName ; ----------------------------------------------- Func _DoesFolderExist() Local $_DoesFolderExist = FileExists($g_SetName) Local $_sTypeFolder = StringMid($g_SetName, 10, 6) Local $_sSubFolder = StringMid($g_SetName, 17) ; ----------------------------------------------- If $_DoesFolderExist Then ; This will never occur, thus the sole purpose of _EnterSetName() ;MsgBox($MB_TOPMOST, "Success!", "The [" & $_sTypeFolder & "] subfolder [" & $_sSubFolder & "] already exists!") Else _CreateFolder() EndIf EndFunc ;==>_DoesFolderExist ; ----------------------------------------------- Func _CreateFolder() MsgBox($MB_TOPMOST, "NOTICE!", "Made it to _CreateFolder!") EndFunc ;==>_CreateFolder ; ----------------------------------------------- The issue: As with the FileSelectFolder Issues, the path must always consist of the following: F:\Audio\TypeName\SetName. However, I found that it IS possible, for me to enter F:\Audio\TypeName - which is an error, and yet the script continues. The very same anomaly occurs if I happen to enter: F:\Audio\TypeName\SetName\wav - which is also an error! As can be observed, after the path has been entered, the _DoesFolderExist function is called...and I would assume that it would be within this function that all of the necessary error trapping would occur?! Thus, I require the "ways-and-means" of being able to trap these errors before continuing on with the _CreateFolder() function. Any assistance in this matter would be greatly appreciated! UPDATE!!! It is not so much that the SetName folder exists, but rather, that the path is correct!! I do hope that this makes sense? Edited 2 hours ago by mr-es335 Added Update!! mr-es335 Sentinel Music Studios Link to comment Share on other sites More sharing options...
ad777 Posted 16 minutes ago Share Posted 16 minutes ago hello mr-es335; i did read your topic and i did understand little bit so what you did say that you want to: Thus, I require the "ways-and-means" of being able to trap these errors before continuing on with the _CreateFolder() function. here is my solution for you: Func _DoesFolderExist() Local $_DoesFolderExist = FileExists($g_SetName) Local $_sTypeFolder = StringMid($g_SetName, 10, 6) Local $_sSubFolder = StringMid($g_SetName, 17) ; ----------------------------------------------- If $_DoesFolderExist Then ; This will never occur, thus the sole purpose of _EnterSetName() ;MsgBox($MB_TOPMOST, "Success!", "The [" & $_sTypeFolder & "] subfolder [" & $_sSubFolder & "] already exists!") Else _beforeProc() _CreateFolder() EndIf EndFunc ;==>_DoesFolderExist ; ----------------------------------------------- Func _beforeProc() ;type here your script EndFunc iam ِAutoit programmer. best thing in life is to use your Brain to Achieve everything you want. Link to comment Share on other sites More sharing options...
mr-es335 Posted 2 minutes ago Author Share Posted 2 minutes ago ad777, I gather that what you are inferring to here, is that "_beforeProc()" is where the error trapping would occur? Correct? 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