Dummy parameterlist not accepted
In a message dated 01-05-98, Robert AH Prins said to All about Dummy
Parameterlist Not A
RP>Can anybody explain why the following program doesn't compile (I've
RP>inserted the errormessages it generates into the source)
RP>mytest: proc options (main) reorder;
RP>dcl sysprint file;
RP>/***** This statement is OK... *****/
RP>dcl i fixed bin (31) init call init_i;
RP>/***** The following statement is not accepted, why not? *****/
RP>IEL0245I S OPERAND MISSING OR INVALID IN EXPRESSION AFTER '1) INIT CALL
RP> INIT_J('.
RP>IEL0288I S INVALID TEXT WITHIN STATEMENT.
RP>dcl j fixed bin (31) init call init_j();
RP>/***** But this one is! *****/
RP>call init_j();
RP>init_i: proc;
RP> i = 1234;
RP>end init_i;
RP>init_j: proc;
RP> j = 1234;
RP>end init_j;
RP>end mytest;
RP>This seems to me to be a bug(?) in the compiler, though one I can live
RP>with, even if it means adding a dummy parameter, but any explanation
RP>would be welcome.
I just took a look at the syntax diagrams for a normal CALL statement and
the CALL option of INITIAL. They are different!
A parameter list, if given, must contain at least one parameter when used in
INITIAL CALL. You are not permitted to use
DCL j FIXED BIN(31) INIT CALL Init_j():
only
DCL j FIXED BIN(31) INIT CALL Init_j:
if there are no parameters. I don't know why the PL/I grammar should be this
way, but the compiler is implementing it correctly.
Regards
Dave
<Team PL/I>
___
* MR/2 2.25 #353 * Walk through doors, don't crawl through Windows.
--
Please remove the '$' in the from line before reply via email.
Anti-UCE filter in operation.