execute

Executes a code variable.

Available in:

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

Syntax

expr execute(code-var[,parm,...])
trigger      code-var
expr         parm

Description

Executes stored code. Returns the value the code returns; if the executed code has no return value, execute() returns a NULL.
code-var specifies the code to execute.

parm (optional) specifies a parameter for code-var.

Example

Prepares an execution stack and sends it to a user function for execution:
{
trigger insrt;
trigger appnd;
.
.
insrt = { move_f2l(1);  field_set(NULL); move_f2l(0); };
appnd = { move_f2l(-1); field_set(NULL); move_f2l(0); };
.
.
if (direction == up) list_mod(stack,1,appnd);
else list_mod(stack,1,insrt);
.
.
exec_stack(stack);
}
exec_stack:
{
int i;
list_seek(parm.0,0);
for (i=list_rows(parm.0);i;i-) execute(list_read(parm.0,0));
}