|
I also use Like and LikeDS to define new data types, though ideally I would like to have a keyword that specifically indicated that a field or data structure was only being used as a definition. This could prevent the data type definitions from accidently being used, and prevent the space for them from being wasted.
Though in most cases the waste of space is negligible, and if you are really worried about it the based trick will prevent even that. What I don't like about the based trick is that it doesn't tell me if the variable is a data type definition, or if it is actually going to be used as a based variable.
BASED(TEMPLATE_ONLY)
Similarly without some kind of "standard", which will vary from shop to shop, or comments in the code, and how many people put as many of those in as they should, there is no way to tell the programmer that "addressDS" or "address_T" or "address*" is a data type not an actual variable.
Although it's not a standard in RPG, it'd be really nice if it were :)
As for specifying the length of a variable, I was only suggesting it for the compiler defined types. Since it would be extremely annoying to have only some of the basic data types available from built in Like definitions.
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.