ERR, ERL Functions ---------------------------------------------------------------------------- Action Return error status. Syntax ERR ERL Remarks After an error, the ERR function returns an integer that is the run-time code for the error. The ERL function returns an integer that is the line number where the error occurred, or the closest line number before the line where the error occurred. Because ERR and ERL return mean-ingful values only after an error, they usually are used in error-handling routines to determine the error and the corrective action. The value returned by the ERR function can be directly set by using the ERR statement. Both the values returned by ERR and ERL can be set indirectly with the ERROR statement. The ERL function returns only the line number, not line labels, located at or before the line producing the error. If your program has no line numbers, or there is no line number in the program before the point where the error occurred, ERL returns 0. ERL values differ between programs compiled with BC and those run under QBX. In programs compiled with BC, ERL is set to the last numbered line in the source file preceding the line where the error occurred. When QBX detects an error in a procedure, it looks for a line number only within the immediate procedure. If the procedure doesn't contain a numbered line, QBX returns 0 for ERL. You can make your programs run identically with both BC and QBX by always including a line number at the beginning of a procedure where an error might occur. See Also ERROR; ON ERROR; RESUME; Table 4.1, "Run-Time Error Codes" Example See the ON ERROR statement programming example, which uses the ERR function.