|
At 09:43 12/17/1998 -0500, Michael Franchino wrote: >this.. I have created a procedure that accepts parameters. This >procedure will fetch a record in a file by key. This file contains >3 fields of 256 bytes (Flat file structure). After finding the >record I asked for, I need to load that field data into a Data Structure >in my main program. The data structure breaks out all of the fields >for me. The problem is that depending upon what record I fetch from >a file points to a different data structure. > >I thought that I could use a pointer to point to a data structure and >pass that to my procedure and have the fields read in moved to that >pointer. My problem is that I don't uderstand how to use RPG/IV pointers >that well and am really confused. My only other choice is to pass back >the data in a field and have the main program move it into a data >structure, but I would prefer to have my procedure do it. Here are a couple of possibilities: D DS1 DS D Field1 D Field2 D Field3 C eval DS1 = Proc1(aa:bb:cc) or: D @DS1 S * Inz(*NULL) D DS1 DS Based(@DS1) D Field1 D Field2 D Field3 C callp Proc1(aa:bb:cc:dd) C eval @DS1 = %Addr(dd) In reality, what you are passing when you pass parameters by reference, is a pointer. Pete Hall peteh@inwave.com http://www.inwave.com/~peteh +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to MIDRANGE-L@midrange.com. | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com. | To unsubscribe from this list send email to MIDRANGE-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.