I have just started using RPG to use *MODULE definitions of subprocedures for prototype parameter calls. I have successfully compiled modules ( CRTRPGMOD ) and used modules in a program ( CRTPGM ).
I have not been able to use the same modules via a service program for a call by reference.
The problem I get is when I try to CRTPGM using a service program that contans my modules. I get the following compile errors:-
Definition supplied multiple times for symbol 'ADDNUMBERS'.
Definition supplied multiple times for symbol 'TEST01M1'.
AddNumbers is defined in TEST01M2.
TEST01M1 calls the TEST01M2 subprocedure ADDNUMBERS.
Any help would be appreciated.
TEST01M1
TEST01M2
TEST01C1
Dazed and confused.
Remember.. 'Depression is just anger without enthusiasum'.
I have not been able to use the same modules via a service program for a call by reference.
The problem I get is when I try to CRTPGM using a service program that contans my modules. I get the following compile errors:-
Code:
CRTRPGMOD MODULE(MyLib/TEST01M1)
SRCFILE(MyLib/QRPGSRC)
DBGVIEW(*LIST)
CRTRPGMOD MODULE(MyLib/TEST01M2)
SRCFILE(MyLib/QRPGSRC)
DBGVIEW(*LIST)
CRTRPGMOD MODULE(MyLib/TEST01M3)
SRCFILE(MyLib/QRPGSRC)
DBGVIEW(*LIST)
CRTSRVPGM SRVPGM(MyLib/TESTSRV1)
MODULE(MyLib/TEST01M3
MyLib/TEST01M1
MyLib/TEST01M2)
EXPORT (*ALL)
CRTPGM PGM(MyLib/TEST01)
MODULE(MyLib/TEST01M1 MyLib/TEST01M2)
ENTMOD(TEST01M1)
BNDSRVPGM (MyLib/TESTSRV1)
Definition supplied multiple times for symbol 'ADDNUMBERS'.
Definition supplied multiple times for symbol 'TEST01M1'.
AddNumbers is defined in TEST01M2.
TEST01M1 calls the TEST01M2 subprocedure ADDNUMBERS.
Any help would be appreciated.
TEST01M1
Code:
H DEBUG DATEDIT(*YMD)
D/COPY QRPGSRC,TEST01C1
D W1Number1 S 13 3
D W1Number2 S 13 3
D W1String1 S 10
D MyResult S 13 3
/FREE
CALLP(E) AddNumbers(10:11:' ');
W1Number1 = 30;
W1Number2 = 40;
W1String1 = 'XXX';
MyResult = AddNumbers(W1Number1:W1Number2:W1String1);
/END-FREE
C SETON LR
TEST01M2
Code:
H NOMAIN
H DEBUG DATEDIT(*YMD)
D/COPY QRPGSRC,TEST01C1
*
* Prototype Boundry Start ------------------
*
P AddNumbers B EXPORT
D PI 13 3
D P1Number1 13 3 VALUE
D P1Number2 13 3 VALUE
D P1String1 10 VALUE
*
D M1Number1 S 13 3
D M1Number2 S 13 3
/FREE
M1Number1 = P1Number1;
M1Number2 = P1Number2;
RETURN P1Number1 + P1Number2;
/END-FREE
*
P AddNumbers E
*
* Prototype Boundry End --------------
*
TEST01C1
Code:
*
* Universal Prototype Definition
D AddNumbers PR 13 3
D 13 3 VALUE
D 13 3 VALUE
D 10 VALUE
Dazed and confused.
Remember.. 'Depression is just anger without enthusiasum'.