|
I do that also, though what I'd really like is for the basic "types", such as Indicator/Boolean, Pointer, Int, LongInt, etc... to be included somehow in the compiler, so that I don't have to /COPY them into every program.
I don't feel that you gain anything at all by typing the following:
D myVar s like(int)
instead of the following:
D myVar s 10I 0
You know what I mean? Six of one, half a dozen of the other.
So, you might define that in a /COPY file like this:
D Address_T ds qualified D based(TEMPLATE) D Line1 40A D Line2 40A D City 13A D State 2A D ZipCode 9A
When you want to use it, you'd create your own copy like this:
D myAddr ds likeds(Address_T)
struct _Address { char line1[41]; char line2[41]; char city[14]; char state[3]; char zipcode[10]; }; typedef struct _Address Address_T;
(the lengths are one byte longer to save space for a x'00' at the end) When you wanted to use it, you'd code:
Address_T myAddr;
So, it's not really that different from what you can do in RPG.
Packed, zoned, and character might be problematic, but maybe they could be handled with something like: like(packed:30:9), or like(char:32), or even like(varchar:1024) for a varying length character field.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.