ERRMOD

Return the module in which the most recent error occurred

WSupported on Windows
USupported on Unix
VSupported on OpenVMS
NSupported in Synergy .NET
xcall ERRMOD([module], [line][, unmangle])

Arguments

module

(optional) A field or record that is returned with the name of the module in which the most recent error occurred. (a)

line

(optional) A field that is returned with the line number of the module in which the most recent error occurred. (n)

unmangle

(optional) One of the following values:

0 = The mangled name is returned. (default)

nonzero = The method name is returned unmangled.

Discussion

The module name is moved to module according to the rules for moving alpha data. The line number is moved to line according to the rules for moving numeric data.

When the error module is a method, the method signature is also returned, and it can be quite large.

Note

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

Important

With Synergy .NET, line has the following restrictions:

  • Line number information is accurate only if the program is built in debug mode. For x86 systems, if an application is built in debug mode, ERRMOD may return the line number of the next executable line (if one exists). This behavior is unstable across .NET versions and platforms.
  • Line is ignored when using an I/O error list.

See also

Assignment statements for the rules for moving alpha and numeric data