× 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.


  • Subject: Re: Using Pointers
  • From: "R. Bruce Hoffman, Jr." <rbruceh@xxxxxxx>
  • Date: Thu, 17 Dec 1998 16:06:34 -0500

Well, yup.  ie.

.....DName+++++++++++ETDsFrom+++To/L+++IDc.Keywords+++++++++++++++++++++++++++++

      * Pointer based data structures for the input buffer.
     D recPoint        s               *

      * Map data structure for before and after images of the record
      *  in the buffer from the external description for the file.
     D recFmt1         ds                  based(recPoint)
      * Rest of structure goes here.

      * Now map another to same place.
     D recFmt2         ds                  based(recPoint)
      * etc.  As many as you need.

      * Actual record space.
     D inArea          ds
     D   area1                      256a
     D   area2                      256a
     D   area3                      256a

      * Point to the area.
     C                   EVAL      recPoint = %addr(inArea)
      * Now all data structures are aligned on same record space.

Hope that helps.
B.

Michael Franchino wrote:

> Anyone,
>
> I am in need of some assistance with RPG/IV pointers. My problem is
> 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.
>
> Thanks in advance,
>
> Michael
> +---
> | 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
> +---



--
===========================================================
R. Bruce Hoffman, Jr. -- IBM Certified AS/400 Administrator

-- The sum of all human knowledge is a fixed constant.
    It's the population that keeps growing!


+---
| 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 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.