Erf Function
Returns the line number in which the error occurred.
Syntax
Erl[(taskNumber)]
Parameters
- taskNumber
- Specify the task number as an integer from 0 to 32. Task number omission or “0” specifies the current task.
Return Values
The line number where the last error occurred.
Description
Erl is used with OnErr. Erl returns the line number in which the error occurred. Using Erl combined with Err, Ert and Era the user can determine much more about the error which occurred.
When the event “Error during Auto Mode” occurs, normal task and NoPause task in AUTO mode stop execution and end the task. If the target task has already ended when using this function for NoEmgAbort task or background task, “Error 2261” is occurred. Use OnErr to acquire information before the task ends.
See Also
Era, Erf$, Err, ErrMsg$, Ert, OnErr
Erl 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)
- What error occurred (Err 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