dazza 0 Report post 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... Share this post Link to post Share on other sites
Xenobiologist 35 Report post 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 Share this post Link to post Share on other sites
PsaltyDS 27 Report post 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 Share this post Link to post Share on other sites
dazza 0 Report post 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 Share this post Link to post Share on other sites