Jump to content

@error


dazza
 Share

Recommended Posts

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 > 0
But to no avail

I reach for a match and a can of petrol...

Link to comment
Share on other sites

#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

I have even tried

If @error > 0
But 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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...