ILE C allows arguments to be passed between procedures that are written in different ILE high-level languages (HLLs).
The calling function must ensure that the arguments are the size and type that are expected by the called function.
ILE C provides a #pragma argument directive to simplify calls to bound procedures in languages such as ILE COBOL and ILE RPG. The #pragma argument directive allows arguments to be passed by mechanisms other than the standard C mechanism.
By default, ILE C procedures pass and accept arguments by value, which means that the value of the data object is placed directly into the argument list. Passing arguments by value allows you to widen integers and floating point values.
ILE RPG passes and accepts arguments by reference, which means that a pointer to the data object is placed into the argument list. Changes that are made by the called procedure to the argument are reflected in the calling procedure. Additionally, ILE RPG can pass arguments by value.
ILE COBOL passes arguments both by reference and by content, which means that the value of the data object is copied to a temporary location. The address of the copy, a pointer, is placed into the argument list. Additionally, ILE COBOL can pass arguments by value.
Table 18 shows the default argument that passes methods on procedure
calls.
Table 18. Argument Passing for ILE Procedures
ILE HLL | Pass Argument | Receive Argument |
---|---|---|
ILE C default | By value | By value |
ILE C with #pragma argument OS | By reference | By reference |
ILE C with #pragma linkage OS directive | Use OS-linkage when calling external programs. | By reference |
ILE COBOL default | By reference | By reference |
ILE CL | By reference | By reference |
ILE RPG default | By reference | By reference |
(C) Copyright IBM Corporation 1992, 2005. All Rights Reserved.