Sign in to follow this  
Followers 0
dazza

@error

4 posts in this topic

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...

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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

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
Sign in to follow this  
Followers 0