APGen Documentation Previous Topic: APGError Object Next Topic: APGError.Description Parent Topic: APGError Object    APGError Object
APGError.Number
See Also:

The APGError.Number property returns the COM error code for the error.

Syntax

VBScript:

nErr = oAPGError.Number

JScript:

nErr = oAPGError.Number;

Object

oAPGError An APGError object.

Return Value

nErr The integer COM error code.  If no error has occurred, this number is 0.  Error numbers may be positive or negative integers.

Notes

If no error has occurred, 0 is returned.

This error code is often most meaningful when viewed in hex:

' Retrieve the error object from a script that was executed
Dim oAPGError, nErr
Set oAPGError = oScript.GetLastError()

' Retrieve the error number
nErr = oAPGError.Number

' If an error occurred, display it in a Message Box
If (nErr <> 0) Then
     MsgBox "Error occurred: 0x" & Hex(nErr)
End If

Applies To

APGError Object