× 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.



John,

so what you're saying is that i might have the same code in several
different copy books used in the same program and that, in the example you
gave, it 'defines APIDS' the first time it copys, and won't copy the code
again.

Could you use it to only copy the prototypes you use in the program?

for instance, if I have a copybook that has 20 prototypes, but I only use 2
of them, can I put this in my main program:

/DEFINE STRING_FUNCT1
/DEFINE STRING_FUNCT2
/copy qrpgsrc,str_svcpgm

and in my str_svcpgm copybook, say this:

/IF DEFINED STRING_FUNCT1
... source for prototype STRING_FUNCT1
/ENDIF
/IF DEFINED STRING_FUNCT2
... source for prototype STRING_FUNCT2
/ENDIF
/IF DEFINED STRING_FUNCT3
... source for prototype STRING_FUNCT3
/ENDIF

which would cause it to stop copying at the 2nd prototype?  am I on the
right track here?

Thanks,

Rick

----original message----------
If you have a common routine or declaration, you can put the /copy in
multiple members. It will not compile the code if the defined name is
already defined.
 /IF NOT DEFINED(APIDS)
 /DEFINE APIDS
 *************************************************************
 *  Definition for error code data structure
 *************************************************************
 * Api Error Data Structure (Copy of QUSEC, but renamed)
D ApiErr          DS
D  AeBytesProv                  10I 0 Inz(%Size(ApiErr))
D  AeBytesAvl                   10I 0
D  AeMsgId                       7A
D  AeErrNum                      1A
D  AeMsgDta                    256A

 /ENDIF



As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.