On Tue, 1 Jan 2002, Harry Williams wrote:

> The parameters for the IFS read API returns the Data which must be defined at 
>a
> max length.  Defining this max length makes RPG init this when the program is
> loaded. If you define the parm at 32000 for a read, then the program must init
> this field when it is loaded.  Is there a way of getting the information 
>without
> reading the data, just getting the pointer?
>
> Moving the pointers is faster than moving the data.
>
> If I define the field at say 512. Then it should return the correct pointer
> location for the data, but I do not think all the data will be guaranteed to 
>be
> there.
>
> I am using the API's but isn't moving the data and clearing the space taking
> longer than passing the pointer?
>
> Harry
>
>
>
>

Please excuse me if I'm completely wrong...  I'm completely new to MI, but
I'm an experienced RPG programmer.  :)  I just hope that what I'm about to
say makes sense from the MI side of things.

When you call the RPG program, just pass everything as a parm.  Parms are
passed by reference from your MI program, so RPG doesn't attempt to
initalize them.   You don't need to set a max length for the data returned
(in the RPG program) because the IFS read() API returns a pointer, not a
character variable.

Perhaps it'd be clearer if I showed a (perhaps oversimplified) example of
the RPG side of things:

     D read            PR                  ExtProc('read')
     D                               10I 0 value
     D                                 *   value
     D                               10I 0 value

     D desc            S             10I 0
     D dtaptr          S               *
     D length          S             10I 0
     D retval          S             10I 0

     c     *entry        plist
     c                   parm                    desc
     c                   parm                    dtaptr
     c                   parm                    length
     c                   parm                    retval

     c                   eval      retval = read(desc: dtaptr: length)


If I'm completely off-base, please let me know gently :)




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.