Sign in to follow this  
Followers 0
Emax

Error not work

3 posts in this topic

#1 ·  Posted (edited)

Why not work ???!?!?!?

$oMyError = ObjEvent ( "AutoIT.Error", "MyErrFunc" )

;Cause error
Dim $a[1]
For $b = 0 To 2
$c = $a[$b]
Next

Func MyErrFunc()
  Msgbox(0,"AutoItCOM Test","We intercepted a COM Error !"  & @CRLF  & @CRLF & _
             "err.description is: " & @TAB & $oMyError.description  & @CRLF & _
             "err.windescription:"   & @TAB & $oMyError.windescription & @CRLF & _
             "err.number is: "     & @TAB & hex($oMyError.number,8)  & @CRLF & _
             "err.lastdllerror is: "   & @TAB & $oMyError.lastdllerror   & @CRLF & _
             "err.scriptline is: "   & @TAB & $oMyError.scriptline   & @CRLF & _
             "err.source is: "     & @TAB & $oMyError.source       & @CRLF & _
             "err.helpfile is: "       & @TAB & $oMyError.helpfile   & @CRLF & _
             "err.helpcontext is: " & @TAB & $oMyError.helpcontext _
            )
EndFunc
Edited by Emax

Share this post


Link to post
Share on other sites



"Why not work" what?

If you think that the ObjEvent() will also capture regular AutoIt3 errors like array subscript errors, then you are mistaken.

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Try Dim $a[3] :)


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

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