× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Remember that the prototype for your program should be in a /COPY file, and that you should copy it into both the calling program and the called program.

Here's one way to handle a /copy file that has a prototype with a file parameter. (I know that all the /define and /undefine directives are ugly, but they're not nearly as ugly as trying to debug problems caused by having the file and prototype defined in two different places.)

/COPY file MYTESTCPY:

/if defined(fspecs)
FTrctCnt_t if e k disk template block(*No)
F extdesc('TRCTCONT')
F Qualified
/endif

/if defined(dspecs)
DMytest1 pr extpgm('MyTest1')
D Parm1 LikeFile(TrctCnt_t)
/endif

Program A, the calling program that actually defines the file, has to copy in the /copy file twice, once to get the F specs and once to get the D specs.

/define fspecs
/copy mytestcpy
/undefine fspecs
FTrctCont Likefile(TrctCnt_t)
F extfile(*extdesc)
/define dspecs
/copy mytestcpy
/Free
Callp MYTEST1(TrctCont);
*Inlr = *On;
/End-Free

Program B, the called program that actually defines the file. It doesn't have any F specs of its own, so it only needs one /COPY

/define fspecs
/define dspecs
/copy mytestcpy
DMyTest1 pi
D Parm1 LikeFile(TrctCnt_t)

DMyVal1 s 1n
D ds ds Likerec(Parm1.fmt1)

/Free
read Parm1 ds;
If ds.emlrdt = 0;
MyVal1 = *On;
Endif;
*Inlr = *On;
/End-Free


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.