|
Hello Mark,
Since Jon hasn't answered this yet, I will. Perhaps you are confused by the
fact that there is
no explicit pointer definition for Array@. Array@ is a based pointer. The
compiler
automatically defines any pointer used in a BASED definition. (I think that
relying on this is
sloppy and the programmer should code the pointer anyway, but that's just me!)
The rest of the code is pretty straight-forward. The only real problem with
such a technique
is that array elements need to be the same size hence the "PADn" variables.
Regards,
Simon Coulter.
«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»
«» FlyByNight Software AS/400 Technical Specialists «»
«» Eclipse the competition - run your business on an IBM AS/400. «»
«» «»
«» Phone: +61 3 9419 0175 Mobile: +61 0411 091 400 «»
«» Fax: +61 3 9419 0175 mailto: shc@flybynight.com.au «»
«» «»
«» Windoze should not be open at Warp speed. «»
«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»
//--- forwarded letter -------------------------------------------------------
> X-Mailer: QUALCOMM Windows Eudora Pro Version 3.0.3 (16)
> Date: Thu, 25 Nov 1999 00:03:41 +1100
> From: "Mark Lazarus" <mlazarus@ttec.com>
> To: RPG400-L@midrange.com
> Reply-To: RPG400-L@midrange.com
> Subject: Using Pointers
>
> Jon,
>
> At 09:44 AM 11/22/99 -0500, you wrote:
>
> I followed the code until I got to Array@ ! Is there a "@" missing
> somewhere?
>
> >The following technique (which does use pointers) could also work but I
> doubt it
> >is worth the effort. PS. The code sample here has been validated by
> Code/400 but
> >not tested.
> >
> >
> > D FakeRecord DS
> > D Elem1 4 Inz('ABCD')
> > D Pad1 10
> > D Elem2 4 Inz('EFGH')
> > D Pad2 12
> > D Elem3 4 Inz('IJKL')
> > D Pad3 5
> > D Elem4 4 Inz('MNOP')
> >
> > D ArrayPtrs DS
> > D * Inz(%Addr(Elem1))
> > D * Inz(%Addr(Elem2))
> > D * Inz(%Addr(Elem3))
> > D * Inz(%Addr(Elem4))
> >
> > D Array * Dim(4) Overlay(ArrayPtrs)
> >
> > D CurrentElem S 4 Based(Array@)
> > D Count S 1 0
> >
> > C For Count = 1 to %Elem(Array)
> > C Eval Array@ = Array(Count)
> > C CurrentElem Dsply
> > C EndFor
>
> -mark
+---
| 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-2025 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.