|
Why 2047? I could make the PtrAry as large as I would like I think. And if I ran out of room, I could use a file instead of the table - although it would be slower. And the filler is necessary - at least on the compiler I use. It complains about alignment otherwise. I think you're right about the Align verb though - it's just hanging there. And the point was the idea - not necessarily my demonstration of perfect syntax - I just typed this off the top of my head - after a glance at some other code. In this case - it's the idea of using pointers to the data in the user space as data itself that can be manipulated as any other data can be. I was offering my help with the idea. Not code to copy and use as printed. -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Scott Klement Sent: Wednesday, 14 September 2005 7:42 To: RPG programming on the AS400 / iSeries Subject: RE: Sorting a user space > D DS Align > D PtrAry 32 Dim(100) > D ThePtr * Inz(*Null) Overlay(PtrAry:1) > D The1stSortField 2A Overlay(PtrAry:17) > D The2ndSortField 2A Overlay(PtrAry:19) > D Filler 12A Overlay(PtrAry:21) That'll work as long as you have 2047 or fewer entries to sort. (or 1023 if you're running an older release of OS/400). Also, your filler field is unnecessary, since the entries in the DS overlay a 32A field, they'll always be aligned on a 32 byte boundary, with or without the filler. Also, the ALIGN keyword is doing nothing in this example, since there's only one field in the data structure, (not counting the overlaid ones) there's no field after it to align.
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.