|
>> Or is there something wrong with this thinking? There is nothing wrong with your thinking as far as it goes. It just doesn't extend into taking RPG history into account. Remember that pointers etc. were retrofitted to RPG relatively late in its life. RPG applies upper bound checking to arrays and MODS based on the size specified. When BASED structures were introduced (for better or worse) no change was made to the code generation in this area. At some point in the future one hopes that the compiler folks (are you listening Hans and Barbara?) will allow us to specify the size of a based array etc. via a variable. If they make the storage reallocate itself magically whenever I change that variable then that would be nice too - but I could live wit just being able to specify the current size. Until such time as they change the compiler - think of it this way - the value for DIM is a sanity check when used with based storage - I set it to a value that says "when it gets this big I must be looping". Then implement your own upper bound check the way you have to (or should do) in many other languages. +--- | 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.