Pointer (Indirection)
PTR 4 INPUT
CHAR 80 INPUT
- CHAR
- SBIN
- UBIN
- BIT
- LEN
Note that the FCHR, PTR, TABLE, RTNV, RTNC, and RTNR data types are not supported for indirection.
If the direction of the second template entry is INPUT, the direction of the first must also be INPUT. If the direction of the second is OUTPUT, the first also can be OUTPUT, indicating that the called routine will set it, or it can be INPUT, indicating that the address of the area for the output value is passed by the caller. The two entries together specify a single parameter, a 4-byte pointer to a data area of the format identified by the second declaration.
TABLE * INOUT Table definition
LEN 4 INPUT Maximum number of rows
LEN 4 OUTPUT Used number of rows
C.PTR 4 INPUT Pointers to buffers
CHAR * OUTPUT Buffers
C.PTR 4 INPUT Pointers to buffer lengths
LEN 2 INPUT Maximum lengths
C.LEN 4 OUTPUT Used lengths for buffers
The call parameters for this template would be:
where:
- maxrows
- indicates the maximum number of buffers usable
- usedrows
- returns the number used on call completion
- bufaddrs
- is an array of pointers to buffers with maxrows elements
- lenaddrs
- is an array of pointers to 2-byte binary values specifying the lengths of the buffers
- lengths
- is an array with maxrows elements, the first usedrows elements of which will be filled in by the called routine with the 4-byte binary lengths of the records placed in the corresponding buffers.
REXX does not support pointers. For REXX CSL calls, the actual variable name must be specified in the parameter list. The REXX CSL interface adds the pointer to the data for input parameters and uses the pointer to find the value to return in the variable for output parameters.