<< Prev        Next >>

ID : 107

CurErr

Function

To return an error code of the currently active controller error.

Syntax

CurErr[(index)]

Guaranteed entry

Index
Designate a stored error index number by integer type data. Negative value cannot be used. This is an optional value. This should be 0 if this is omitted.

Return value

Return the error code of the currently active error by integer type data.

Description

Return the error code of the currently active controller error.

Function used at supervisory task or panel screen task which is executable on errors.

When multiple errors occurred, they are stored as an array until error will be cleared. Lower number will be assigned to a newer error in an array. When you acquire the latest error, designate "0" in index number.

"0" will be returned, when designating an index number which does not include an error.

Attention

-

Example

'!TITLE "Acquiring All Errors Currently Occurred"
' Acquire an error code and error message

Sub Sample_CurErr
  
  Dim aaa As Integer
  aaa = 0
  
  Do While CurErr(aaa)  'Execute if an error is occurred
    PrintDbg Hex(CurErr(aaa)) & " : " & ErrMsg(CurErr(aaa))
    aaa = aaa + 1
  Loop

End Sub

ID : 107

<< Prev        Next >>