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



I didn't think abou that,  my problem was losing data by other processes 
because the
full 32000 was not reserved.  This might do it though.  I will try it. The 
problem was
not the program in these cases, it was other programs stepping on these 
parameters.
But with the * it might be reserved.  I will try it.

Scott Klement wrote:

> 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 :)
>
> _______________________________________________
> This is the MI Programming on the AS400 / iSeries (MI400) mailing list
> To post a message email: MI400@midrange.com
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/cgi-bin/listinfo/mi400
> or email: MI400-request@midrange.com
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/mi400.



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.