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



I struggled with this same issue as I began to use more procedures in my
coding and finally settled on using a copy member with all the procedure
prototype and interface definitions.  For example, the entries for a
procedure might look like the following (note that column positions are not
accurate):

D/IF DEFINED(Procedure1)
D/IF DEFINED(Prototype)
D* A description of the procedure
D*********************************
DProcedure1      PR 
D/ELSE
D                PI    
D/ENDIF
D  Parameter1          LIKE(SomeField)
D  Parameter2          LIKE(AnotherField)
D/ENDIF

The calling program would then have the following defined:
/DEFINE Procedure1
/COPY SourceFile/CopyMember
/UNDEFINE Procedure1

In this way, both the procedure and the program calling it can use the copy
book for the parameters and return values definition.  I also get built in
documentation regarding what procedures the calling program is using.

I also have data structure definitions in the copy member, including the
definition for the 
externally described data structure that uses the field reference file.  I
use this member for other data structure definitions instead of physical
files now because I can define meaningful field names and get all the
advantages of an external description. 

Hope that helps.

Donald R. Fisher, III
Project Manager
Roomstore Furniture Company
(804) 784-7600 extension 2124
DFisher@xxxxxxxxxxxxx

<clip>
        *       A sub-procedure is actually a copy-book. I haven't
worked out how to define the prototype parameter as a reference to an
external data dictionary. Therefore, the field definition is whatever is
hard-coded in the parameter declaration. Is this correct, or is there
another way?
        *       A program which requires the prototype needs to make
sure that the parameter passed to the procedure matches the attributes
declared in the prototype. If the prototype definition changes then it
seems extremely difficult to manage the amendment of all the programs
which use the prototype/procedure.
        *       Because the prototype is a source file and not an
object, the D-spec declaration cannot reference the prototype
declaration and because the prototype is a source file, it cannot share
a common definition reference.
<clip>

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.