IBM AS/400 Frozen Dessert Maker User Manual


 
Using the Fixed-Form Call Operations
For more information on operational descriptors, see “Using Operational
Descriptors” on page 138.
There are further restrictions that apply when using the CALL or CALLB opera-
tion codes. For a detailed description of these restrictions, see the
ILE RPG for
AS/400 Reference
.
Examples of CALL and CALLB
For examples of using the CALL operation, see:
“Sample Source for Debug Examples” on page 211, for example of calling an
RPG program.
For examples of using the CALLB operation, see:
Figure 45 on page 99, for an example of calling a procedure in a service
program.
Figure 56 on page 123, for an example of calling bindable APIs.
“CUSMAIN: RPG Source” on page 347, for an example of a main inquiry
program calling various RPG procedures.
Passing Parameters Using PARM and PLIST
When you pass parameters using fixed-form call, you must pass parameters using
the PARM and PLIST operations. All parameters are passed by reference. You can
specify that an operational descriptor is to be passed and can also indicate that a
parameter is omitted.
Using the PARM operation
The PARM operation is used to identify the parameters which are passed from or
received by a procedure. Each parameter is defined in a separate PARM operation.
You specify the name of the parameter in the Result field; the name need not be
the same as in the calling/called procedure.
The Factor 1 and factor 2 entries are optional and indicate variables or literals
whose value is transferred to or received from the Result Field entry depending on
whether these entries are in the calling program/procedure or the called
program/procedure. Table 12 shows how factor 1 and factor 2 are used.
Note: The moves to either the factor 1 entry or the result-field entry occur only
when the called procedure returns normally to its caller. If an error occurs
while attempting to move data to either entry, then the move is not com-
pleted.
Table 12. Meaning of Factor 1 and Factor 2 Entries in PARM Operation
Status Factor 1 Factor 2
In calling
procedure
Value transferred from Result
Field entry upon return.
Value placed in Result Field
entry when call occurs.
In called
procedure
Value transferred from Result
Field entry when call occurs.
Value placed in Result Field
entry upon return.
150 ILE RPG for AS/400 Programmer's Guide