IBM AS/400 Frozen Dessert Maker User Manual


 
Program/Procedure Call Overview
Sometimes you may not be sure of the exact format of the data that is being
passed to you. In this case you may request that operational descriptor be
passed to provide additional information regarding the format of the passed
parameters.
Number of parameters
In general, you should pass the same number of parameters as expected by
the called program or procedure. If you pass fewer parameters than are
expected, and the callee references a parameter for which no data was
passed, then the callee will get an error.
Passing less data
If you pass a parameter and you pass too little data, your application may not
work correctly. If changing the parameter, you may overwrite storage. If using
the parameter, you may misinterpret the parameter. By prototyping the param-
eter, the compiler will check to see that the length is appropriate for the param-
eter.
If the callee has indicated (through documentation or through that prototype)
that a parameter can be shorter than the maximum length, you can safely pass
shorter parameters. (Note, however, that the called procedure must be written
in a way to handle less data than required.)
Order of evaluation
There is no guaranteed order for evaluation of parameters on a prototyped call.
This fact may be important, if a parameter occurs more than once in the param-
eter list, and there is the possibility of side effects.
Interlanguage call considerations
Different HLLs support different ways of representing data as well as different
ways of sending and receiving data between programs and procedures. In
general, you should only pass data which has a data type common to the
calling and called program or procedure, using a method supported by both.
Table 10 on page 133 associates the above considerations with the two types
parameters: prototyped or non-prototyped.
132 ILE RPG for AS/400 Programmer's Guide