Note: Built-In Function Rules Usage Options
Places a numeric variable/value onto the exchange list.
Platform Notes
Note the difference between the maximum length of the value:
30.9 in IBM i and 63.63 in Visual LANSA
Arguments
|
Return Values
No values are returned by this Built-In Function.
Examples
This function can be used to exchange a variable to another function, with a different name. That is, exchange the value of field #PRDTOTAL but give the field a different name, e.g. #TOTAL.
********** Calculate product total
**********
SELECT FIELDS(#COST) FROM_FILE(PRDMST)
KEEP_TOTAL OF_FIELD(#COST) IN_FIELD(#PRDTOTAL)
ENDSELECT
**********
********** Exchange PRDTOTAL as TOTAL
**********
USE BUILTIN(EXCHANGE_NUMERIC_VAR)
WITH_ARGS('TOTAL' #PRDTOTAL)
CALL PROCESS(PPPPPPPP) FUNCTION(FFFFFFF)
This Built-In Function can also be used in place of the EXCHANGE command, i.e. to simply exchange a value.
EXCHANGE FIELDS(#PRICE)
CALL PROCESS(PPPPPPPP) FUNCTION(FFFFFFF)
is functionally identical to the following:
USE BUILTIN(EXCHANGE_NUMERIC_VAR)
WITH_ARGS('PRICE' #PRICE)
CALL PROCESS(PPPPPPPP) FUNCTION(FFFFFFF)