dazza Posted September 4, 2008 Share Posted September 4, 2008 I have run this code: $all_folders = _FileListToArray($path, $fragment, 1) msgbox(0, "error", @error) If @error = 4 then exit EndIf msgbox(0, "", "shouldn't get here!") The msgbox returns @error = 4 but the code is not doing the exit; it returns the second message box? I am at a complete loss why I have even tried If @error > 0But to no avail I reach for a match and a can of petrol... Link to comment Share on other sites More sharing options...
Xenobiologist Posted September 4, 2008 Share Posted September 4, 2008 #include <File.au3> $all_folders = _FileListToArray('c:\', '*.zhzgzjkhjjj', 1) $err = @error MsgBox(0, "error", @error) If $err = 4 Then Exit EndIf MsgBox(0, "", "shouldn't get here!") Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
PsaltyDS Posted September 4, 2008 Share Posted September 4, 2008 I have even tried If @error > 0But to no avail I reach for a match and a can of petrol... That's because the @error returned by MsgBox() was 0. Xenobiologist shows you how to save the error code. 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...
dazza Posted September 4, 2008 Author Share Posted September 4, 2008 Works a treat. I can now see the light again. I put the can of petrol down. I remove the noose from my neck. I put the Pot Noodle away. Cheers 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