I have a program that I am calling as a procedure in another program (CALLP). My intentions were to pass parms 1-3 as input only parms and have the 4th parm modified by RTVLOCOVR and returned to the calling program. This works fine and RTVLOCOVR successfully populates the 4th parameter and returns it to the caller. I suddenly noticed that I specified unintentionally CONST in the the 4th parm of the prototype, so I had to wonder, why does it return a value? Doesn't CONST make it read only?
Here is the procedure being called in the program:
Here is the prototype in RTVLOCOVR (no CONST specified)
As I mentioned RTVLOCOVR appears to return wkCmd successfully populated, I am surprised. Does this work differently than I thought. Does it even matter how the 4th parm is defined (CONST or not)in the calling program. The 2 prototypes don't match in that regard.
Code:
[FONT=courier new] DRTVLOCOVR PR EXTPGM('RTVLOCOVR') D 2 CONST D 10 CONST D 3S 0 CONST D 1024 CONST [/FONT]
Here is the procedure being called in the program:
Code:
C Clear wkCmd C Callp RTVLOCOVR (ORLCFM : 'BOL6 ': C 1 : wkCmd)
Here is the prototype in RTVLOCOVR (no CONST specified)
Code:
DCL-PI RtvLocOvr; prmLoc Char(2) Const; prmPrtFile Char(10) Const; prmKey Zoned(3) Const; prmCmd Char(1024); END-PI;
As I mentioned RTVLOCOVR appears to return wkCmd successfully populated, I am surprised. Does this work differently than I thought. Does it even matter how the 4th parm is defined (CONST or not)in the calling program. The 2 prototypes don't match in that regard.
Comment