trap

Traps any errors that occur during the execution of code.

Available in:

Apps (win) Apps (char) Reportwriter RPC Standalone PL
X X X X X

Syntax

int trap(code)
block    code

Description

Returns true on error, otherwise false.

Example

Catches database error if table does not exist.
{
list LL;

if (trap({ LL = list_open("SELECT * FROM " ^^ parm.0,100); }))
  error("Table " ^^ parm.0 ^^ " does not exist");
.
.
}