mr-es335 Posted November 1 Share Posted November 1 (edited) Good day, I very much enjoy Autoit. However, I do find the Helpfile rather confusing at times. For example. DirCreate...am I not able to employ the return values of DirCreate "on its own" - without the need for "FileExists"...as the Helpfile example displays? DirCreate("C\Me") Local $Result = "" If $Result = 1 Then ; Success?? MsgBox($MB_SYSTEMMODAL, "", "The .edl folder was created successfully!") Else ; Failure?? MsgBox($MB_SYSTEMMODAL, "", "The .edl folder was not created successfully!") EndIf Edited November 1 by mr-es335 mr-es335 Sentinel Music Studios Link to comment Share on other sites More sharing options...
mr-es335 Posted November 1 Author Share Posted November 1 Good day, I did...finally ...come across this little tid-bit: $error = DirCreate("C:\Folder1") MsgBox(0,'$error',$error) Source: [Iod3n] As long as the destination can be written to, then the error will return "1"! Correct"? Following, is my updated example: Local $error = DirCreate("C:\Folder1") If $error = 0 Then MsgBox(0, "NOTICE!", "Folder was not created", $error) Else MsgBox(0, "NOTICE!", "Folder was created", $error) EndIf Question: May I ask, in the first example, the $error value is displayed...but not in the second example...why? mr-es335 Sentinel Music Studios Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 1 Moderators Share Posted November 1 mr-es335, In your first script, where do you store the return value from the DirCreate function? How can you check it when you have no idea what it is? All you are checking is the value of the $result variable - which you have just set to "" and so makes any checking completely pointless. In the second set of scripts you are storing the return value, but I would question your use of $error as the variable name as it would appear to me to be the exact reverse of that and better named $iSuccess! And as to why the return value is not shown in the latter of the 2 scripts - perhaps you should look carefully at how many parameters are you passing to the MsgBox functions? 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