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



On 2019-04-15 10:56 AM, Jon Paris wrote:
Chris is correct but I would also suggest you consider getting rid of the Char(15) length on the DS - it serves no purpose - other than possibly to confuse people and give you one more thing to change should the DS get larger.

As to the "best" place. Personally I would place the DS template in one of two places depending on where it is used.

If it is widely used, even when not being used as a parm, then include it in a copy source for "standard data types" and include that in all programs that need it. Since a template takes up no memory there is no harm in having hundreds of templates even if you only use one.

If it is always used as a parm then I would include it in the same source member as all the prototypes.


As a rule of thumb, any definitions that the prototype depends on should also be in the same copy file.

I would define anything in a copy file as a template, and I would use some naming convention such as ending with _t or starting with template_, to indicate that it is a template. And I would define all template data structures as qualified.

So your copy file would look like this:

dcl-ds plist1_t extname('PLIST1DS') qualified template inz;
end-ds;

dcl-pr VS_RateShop char(15) ExtProc('VS_RateShop');
inPlist1 likeds(plist1_t) const;
end-pr;

And ideally, you would define any other PLIST1's in my code as being LIKEDS(plist1_t). But it would be non-trivial to change any existing definitions of PLIST1, since defining them as LIKEDS would make them qualified, which would mean you'd have to change all the code using the subfields.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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.