|
On 2011/3/8 12:13 PM, M. Lazarus wrote:
> Given this code:
> ...
> At this point, the first element of Array2 should be positioned over the
> last element (#10) of Array1. Assuming I don't attempt to access element
> 2 in Array2, is this safe to do or will the shift of Array2, elements
> 2-10, overlay memory it shouldn't?
>
Mark, what's the purpose of having two arrays exactly the same except
for the subfield names?
By the way, to code the DIM keyword for a DS, you'll be forced to code
the QUALIFIED keyword, so you won't have to worry about having the same
subfield names in the two data structures.
If you do need two data structure arrays for some reason, you'd be
better off defining one of them with LIKEDS to guarantee you get the
same layout.
But I agree with others in this thread that you're setting up a
dangerous situation by defining Array2 with the same number of elements
as Array1, while intending to position the Array2 ypointer somewhere
after the first element of Array1. If you're only intending to use the
first element of Array2 anyway, why make it an array?
And now I wonder, why bother with the overlay in the first place? Why
not just use Array1(10).Field1 etc?
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.