Sign in to follow this  
Followers 0
amokoura

Exception handling in AutoIt

1 post in this topic

Here's a template for simulating exceptions.

$exceptionCode = 0

;;; TRY
Do 
; Perform possibly erroneous functions
; In case of error:
;   $exceptionCode = [integer]
;   ExitLoop
; and the rest of the try block will not be executed
Until 1
    
    
;;; CATCH
Switch $exceptionCode
    Case 0      ; no exception
    Case [integer]; specific exception
    case Else   ; unknown exception
EndSwitch


;;;;FINALLY
; Perform finalizing functions here
;
; If we want to pass exception code back in call stack:
; setError($exceptionCode)

I posted this before in support forums but that was the wrong place.

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