Return the line number of the statement that caused an error

WTSupported in traditional Synergy on Windows
WNSupported in Synergy .NET on Windows
USupported on UNIX
VSupported on OpenVMS
line = %ERLIN

Return value


The line number of the statement that caused the most recent trappable error. (n)


%ERLIN is identical to DIBOL’s %ERLINE, and you can substitute one for the other.


The %ERLIN routine is not supported in multi‑threaded scenarios, and you must use TRY‑CATCH under these circumstances.


With Synergy .NET, line has the following restrictions:

  • Line number information is accurate for Windows and UNIX desktop and server applications only if the program is built in debug mode. And for x86 systems, if an application is built in debug mode, %ERLIN returns the line number of the next executable line (if one exists) after the line for the requested routine. This is a Microsoft .NET Framework CLR limitation.
  • With Universal Windows Platform (UWP), %ERLIN always returns a line value of 0.


The following routine displays the most recent Synergy DBL error number, text, and line number.

subroutine proc_error
.define TTCHN           ,1
    msg                 ,a45
    xcall ertxt(%ernum, msg)
    writes(TTCHN, "Error#" + %string(%ernum) + ": " msg +
  &        " at line " + %string(%erlin))