|
Hi Joe, Just curious, but doing it that way, why not use a MODS or an array of qualified structures? Then you wouldn't have to use pointer math to walk through the list. (Though, you'd still have to use it to set the start of the list.) I was actually using this with the system "List APIs" however, and the size of each entry is not necesarily a fixed number. (or, even if it is, it can change from release to release, which would break the code the way you've written it) Thanks for the input! > If your entries have a predefined size and you're using an externally > described data structure to access them, I have a rather elegant way to > do it (at least IMHO): > > d Entry e ds extname(myEntry) > d based(p_Entry) > d Entries s like(Entry) dim(MAX) > d based(p_Entries) > > c eval pEntries = p_ListHeader + DataOff > c for EntryNo = 1 to NumEntries > c eval pEntry = %addr(Entries(EntryNo)) > (process entry) > c endfor > > Set MAX to some reasonable maximum value, and voila, you should have no > problems. (Famous last words!)
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.