I have a prototype in my free program to call an external program. The parms on my prototype include two fields that are defined as 2S 0. The value of these two fields are 00 and 01 at the time of the call tothe prototype. Using debug, I step into the program being called and the value of these two variables have changed when I look at the entry list in that program. The called program is not written in free. I have tried this call with and without the CONST keyword. How can I keep this from happening?
Software/Hardware used:
IBMi Version V6R1
ASKED:
October 4, 2011 3:08 PM
UPDATED:
March 31, 2012 12:42 AM
Here is the prototype from the calling program (written in free):
D ManageCert PR ExtPgm('SO311R') D pAction 1A Const D pCallIdNt 1A Const D pFrmDoc 20A Const D pInvSufx 2S 0 Const D pNewDoc 20A Const D pMcaSufx 2S 0 Const D pBlindKey 9P 0 Const D pPrefix 1A Const D pCust 6A ConstHere are the entry fields (pFrmSfx and pNewSfx) from the called program (not written in free):
** Parm Entry Fields D pAction s 1a D pCallIdnt s Like(SO0IDNT) D pFrmDoc s Like(SO0NBR) D pFrmSfx s Like(SO0VSN) D pNewDoc s Like(SO0NBR) D pNewSfx s Like(SO0VSN) D pBlindKey s Like(SO0CKEY) D pCustPrfx s Like(SO0PRFX) D pCustNmbr s Like(SO0NMBR)A SO0VSN R REFFLD(RFSUFX) A COLHDG('Revision Number')Here is the reference field definition:
A RFSUFX 2S 0 TEXT('Invoice Suffix') A COLHDG('Invoice' 'Suffix')…the value of these two variables have changed when I look at the entry list in that program.
The values have changed to what?
How are you calling the program? The fields that you list as entry fields (pFrmSfx and pNewSfx) from the called program get values in them from where?
Tom
The values in the variable have changed to 0 and a null character. The call looks like:
ManageCert(pAction:pCallIdNt:pFrmDoc:pInvSufx:pNewDoc:pMcaSufx: pBlindKey:pPrefix:pCust);The pInvSuf and the pMcaSufx populate the pFrmSuf and the pNewSuf. ThepInvSuf is the suffix to an exisiting invoice in our database and the pMcaSuf is the next available suffix number for that same invoice number.
The pInvSuf and the pMcaSufx populate the pFrmSuf and the pNewSuf.
Yes, but how?
Are they referenced through an *ENTRY PLIST? If so, what does the PLIST look like? Are they EVALed from prototyped parameters in the called program? (Or is it MOVE instead of EVAL?) If so, what does that prototype look like?
Show how those fields receive their values.
Note that it is irrelevant whether the code is /FREE or not. The values won’t change based on coding format, but only by the definitions of the data and the op-codes used.
Tom