Jump to content

Error not work


Emax
 Share

Recommended Posts

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
Link to comment
Share on other sites

  • Developers

"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

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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