Cool, the newer versions of PL/1 support this, too,
when using the BYVALUE keyword on the ENTRY declarations:

DCL CFUNC ENTRY
(BIN FIXED (31) BYVALUE,
 BIN FLOAT (53) BYVALUE,
 POINTER BYVALUE)
RETURNS (BIN FIXED(31));

and then:

DCL X BIN FIXED (31);
DCL Y BIN FLOAT (53);
DCL P POINTER INIT (ADDR(STRUCT));

RC = CFUNC (X, Y, P);

not sure about the syntax, just a guess. Didn't test it.

Kind regards

Bernd



Am 08.11.2011 02:32, schrieb Frank Swarbrick:
FWIW, COBOL can now call by value, if desired.


given:

int cfunc (int x, double x, struct t *p);

do this:
call 'cfunc' using value cobol-fullword cobol-double
reference cobol-structure
              returning ret-fullword


Frank





----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to