Ert Function

Returns the task number in which an error occurred.

Syntax
Ert

Return Values
The task number in which the error occurred.

Description
Ert is used when an error occurs to determine in which task the error occurs.

No task with error (0), normal task (1 to 32), back ground task (65 to 80), TRAP task (257 to 267).

See Also
Era, Erl, Err, ErrMsg$, OnErr, Trap

Ert Function Example
The Following items are returned in the program example below.

  • In which task the error occurred (Ert function)
  • Where the error occurred (Erl function)
  • On which joint the error occurred (Era function)
Function main
  OnErr Goto eHandler
  Do
    Call PickPlace
  Loop
  Exit Function
eHandler:
  Print "The Error code is ", Err
  Print "The Error Message is ", ErrMsg$(Err)
  errTask = Ert
  If errTask > 0 Then
    Print "Task number in which error occurred is ", errTask
    Print "The line where the error occurred is Line ", Erl(errTask)
    If Era(errTask) > 0 Then
      Print "Joint which caused the error is ", Era(errTask)
    EndIf
  EndIf
Fend