I have a problem with a macro G_TYPE_MAKE_FUNDAMENTAL
Can anybody help me?
Source code:
%dcl #__GTYPE_CPY__ char ext;
%if #__GTYPE_CPY__ = '' %then %do;
%#__GTYPE_CPY__ = 'Y';
/* .... */
%G_TYPE_MAKE_FUNDAMENTAL: proc(x) returns(char);
dcl x char;
return("ISLL("||x||", G_TYPE_FUNDAMENTAL_SHIFT)");
%end G_TYPE_MAKE_FUNDAMENTAL;
%activate G_TYPE_MAKE_FUNDAMENTAL;
/* .... */
%end; /* %if #__GTYPE_CPY__ = '' %then %do; */
Compiler command line:
PLI MainWindow.pli (NOLIBS, SOURCE, SYSTEM(WINDOWS, PENTIUM), NOLOGO)
Compiler message:
gtk+\include\gtype.cpy(59:1) : IBM3916I S The procedure
G_TYPE_MAKE_FUNDAMENTAL has already been defined.
Merci d'avance....
Christophe
PL/I macro code is not linearly interpreted; it is "compiled" before it
is run. Therefore, you can't say:
%IF ... %THEN %DO;
% x: PROCEDURE....
%END;
%END;
%ELSE %DO;
% x: PROCEDURE....
%END;
%END;
in macro PL/I any more than you could do the equivalent in regular PL/I.
You have to write a single G_TYPE_MAKE_FUNDAMENTAL and put the IF inside it.
The procedure has already been defined. That means that you have introduced
it before.