ID : 438
Err.Number
Function
This property contains an error code of task error.
Syntax
Err.Number
Return value
Value of an error code is returned. An error code is integer type data.
Description
This converts a system-specific error code or a device-specific error code to a PacScript-error code, and then stores it when an task error occurs.
This command can readout values but cannot write in.
Related Terms
Err.OriginalNumber, Err.Level, Err.Description, Err.Raise, Error handling in PacScript, ERROR CODE
Attention
-
Example
'!TITLE "Display Error Code"
' Display error code of a stored error object on the message output window
Sub Sample_ErrNumber
On Error GoTo LABEL1
Dim aaa As Integer
Dim bbb As Integer
aaa = 100
bbb = 0
' Error occurs during zero divide
aaa = aaa / bbb
Exit Sub
LABEL1:
' Display error code on the message output window
PrintDbg Err.Number
End Sub
ID : 438