|
>> Is there a better way? (I hope so!) Should I use C? (sigh) No need to use C although for a situation like this I would tend to use dynamic memory and Alloc the amount I needed for the structure in question. That way you are ensured of contiguous storage. Right now I'm pretty certain that the compiler will always place a MODS in a contiguous area, but in theory at least there is no reason why it has to. Besides - why "waste" storage just-in-case it ever gets to (whatever) size? Just Alloc what you need when you need it. Remember - the size of a field is only used to reserve storage, control moves and to check limits for substrings etc.- if you're using dynamic memory it only needs to be defined as being as large as the biggest single element you will ever reference within it. +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
As an Amazon Associate we earn from qualifying purchases.
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.