× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Barbara,

The easy answer to several of the questions is that (unfortunately) this needs to compile back to v4r5. You're correct, of course, about the DIM() on the DS, but in the sample I was working with I actually had it defined as the first field and the other fields were using Overlay() and Overlay(*Next). Many the techniques that I'd love to be able to use, just aren't available for this client.

The idea behind this technique is that a screen is displayed to the user. The user may want to reposition the view to any "record" any number of times. An easy way to code this "window / view" would be to just reassign the pointer to the proper element when the user requests the reposition and (almost) no other code has to change. Otherwise, the offset always needs to be taken into account, making the code harder to read, IMHO.

I load Array1 with the full data set. Array2 is then used to display and manipulate the data. Therefore, the array index always = the subfile RRN.

-mark


At 3/8/2011 01:36 PM, you wrote:
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 thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.