CALL Command

CALL — Execute a specified logic block.

Synopsis

[LET ret_value = ] CALL logic_name [logic_argument...] [RETURNING ret_value [ret_value ...] ]

Introduction

The CALL command executes a specified logic block. Arguments can be passed and return values can be retrieved.

Arguments

ret_value

Value returned by the RETURN command of the called logic. If more than 1 value is returned, the keyword RETURNING must be used to assign data references to the returned values. When only 1 value is returned, the keyword RETURNING is optional. The returned value can in that situation also be retrieved as a resultant of the logic in combination with the LET command. If no values are returned, the keyword RETURNING must be omitted.

logic_name

Contains the name of the logic block. This can either be a string or a data reference.

logic_argument

Value which can be passed into a logic block. The command PARAMETER within that logic block will assign the values to local variables.

Example

. . .
. . .
CALL GetOrderCustomer L-CustomerNumber L-Date RETURNING L-Status L-Totals
. . .
. . .
LET L-Totals = CALL GetOrder L-OrderNumber
. . .
. . .

Related Commands

PARAMETER RETURN