|
One of the problems is the init of the rpg program. A three line RPG program
will
create 30 pages of MI. Some of the MI commands do a lot of work. The first time
the
rpg is called there is a load generated on the system. If I only call it once
or bind
everything together I might keep the effort down on 2ed, 3ed, ... calls.
Harry
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 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.