I want to call valence's getAppVar procedure from an RPGLE service program, but I can't get it to compile. I was wondering if I could provide some context and see if there is anything I can do to make this possible.
I have a Valence CNX application.
This application has one app variable called "myAppVar".
This application has a button that calls a SQLRPGLE "button helper" program called ADRB000001.
The button helper calls a service program (ADZAPPVAR) and I want this service program to call valence's getAppVar procedure.
Here is my button helper (ADRB000001.SQLRPGLE):
**Free
/Include SPCHdrDft // Default action group that includes VVBNDDIR, but without the NOMAIN keyword
/Include qcpylesrc,vvNabBtn // NAB Button Helper copybook
/Include ADHAPPVAR // Copybook for service program
Initialize();
Process();
CleanUp();
*InLr = *On;
Dcl-Proc Process;
Dcl-S myAppVar Char(1);
Monitor;
myAppVar = TSTGETAPPVAR();
On-Error;
setResponse('info' : 'Failure');
EndMon;
setResponse('info' : 'Success');
End-Proc;
/Include qcpylesrc,vvNabBtn // NAB Button Helper copybook, again
Here is my service program's *MODULE (ADZAPPVAR.SQLRPGLE):
**free
/Include SPCZHdrDft // Default action group that includes VVBNDDIR, but with the NOMAIN keyword
Dcl-Proc TSTGETAPPVAR Export;
Dcl-Pi *N Char(1);
End-Pi;
Dcl-S myAppVar Char(1);
//myAppVar = getAppVar('myAppVar');
Return myAppVar;
End-Proc;
Here is my service program's *SOURCE (ADZAPPVAR.BND):
StrPgmExp PgmLvl(*Current) Signature("ADZAPPVAR 1.0")
Export Symbol(TSTGETAPPVAR)
EndPgmExp
Here is my service program's copybook (ADHAPPVAR.RPGLE):
**Free
/If Defined(I_ADHAPPVAR)
/Eof
/EndIf
/Define I_ADHAPPVAR
Dcl-Pr TSTGETAPPVAR Char(1);
End-Pr;
This all compiles fine until I uncomment this line from the service program's *MODULE:
//myAppVar = getAppVar('myAppVar');
I have tried:
But as long as myAppVar = getAppVar('myAppVar'); is uncommented, my service program fails to compile.
Is there anything that I can do to make this work?
I have a Valence CNX application.
This application has one app variable called "myAppVar".
This application has a button that calls a SQLRPGLE "button helper" program called ADRB000001.
The button helper calls a service program (ADZAPPVAR) and I want this service program to call valence's getAppVar procedure.
Here is my button helper (ADRB000001.SQLRPGLE):
**Free
/Include SPCHdrDft // Default action group that includes VVBNDDIR, but without the NOMAIN keyword
/Include qcpylesrc,vvNabBtn // NAB Button Helper copybook
/Include ADHAPPVAR // Copybook for service program
Initialize();
Process();
CleanUp();
*InLr = *On;
Dcl-Proc Process;
Dcl-S myAppVar Char(1);
Monitor;
myAppVar = TSTGETAPPVAR();
On-Error;
setResponse('info' : 'Failure');
EndMon;
setResponse('info' : 'Success');
End-Proc;
/Include qcpylesrc,vvNabBtn // NAB Button Helper copybook, again
Here is my service program's *MODULE (ADZAPPVAR.SQLRPGLE):
**free
/Include SPCZHdrDft // Default action group that includes VVBNDDIR, but with the NOMAIN keyword
Dcl-Proc TSTGETAPPVAR Export;
Dcl-Pi *N Char(1);
End-Pi;
Dcl-S myAppVar Char(1);
//myAppVar = getAppVar('myAppVar');
Return myAppVar;
End-Proc;
Here is my service program's *SOURCE (ADZAPPVAR.BND):
StrPgmExp PgmLvl(*Current) Signature("ADZAPPVAR 1.0")
Export Symbol(TSTGETAPPVAR)
EndPgmExp
Here is my service program's copybook (ADHAPPVAR.RPGLE):
**Free
/If Defined(I_ADHAPPVAR)
/Eof
/EndIf
/Define I_ADHAPPVAR
Dcl-Pr TSTGETAPPVAR Char(1);
End-Pr;
This all compiles fine until I uncomment this line from the service program's *MODULE:
//myAppVar = getAppVar('myAppVar');
I have tried:
- Putting /Include qcpylesrc,vvNabBtn before the Dcl-Proc statement and after the Dcl-Proc statement in the service program's *MODULE object
- Putting /Include qcpylesrc,vvNabBtn only before the Dcl-Proc statement in the service program's *MODULE object
- Putting /Include qcpylesrc,vvNabBtn only after the Dcl-Proc statement in the service program's *MODULE object
But as long as myAppVar = getAppVar('myAppVar'); is uncommented, my service program fails to compile.
Is there anything that I can do to make this work?
Comment