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



Bryan,

I covered this a year or two ago in an article on mcpressonline.com
One solution is to base a data structure with DIM(x) (where x is the maximum
number of items you every want to have) such as DIM(32767) on a pointer.

D myStuff DS Dim(32767) Based(ptrUserSpace)
D LikeRec(mySubfileReocord)

Then create a second user space and change the attribute to Auto-Extend.
Next, get a pointer to it, using QUSPTRUS.
Assign that pointer to ptrUserSpace.

Okay, now the DS is mapped to the user space and automatically grows as needed.

Start reading your output from QUSLOBJ and instead of populating the subfile,
populate the MYSTUFF data structure array.

Then fill up a page of subfile records (page=size or page at a time).
With a page-at-a-time subfile, when they scroll passed 9999 or some other
smaller number, clear and start reloading the subfile at the new location.

With a page=size subfile, you can roll forwards or backwards with easy by just
changing the array index and reading forward while looping through the data
structure array elements.

If you have RPG xTools all that goofy linked list stuff and API headers is
hidden in the CrtObjList() subprocedure along with the GetNextItem()
subprocedure. But sounds like you probably already have code in place to do
that kind of stuff.


-Bob Cozzi
www.i5PodCast.com
Ask your manager to watch i5 TV



-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On
Behalf Of Bryan Dietz
Sent: Tuesday, May 15, 2007 7:57 AM
To: RPG programming on the AS400 / iSeries
Subject: today's how-best-to question...

I have a how-best-to question:

I have a utility program that gets a list of objects using the QUSLOBJ
API then retrieves info about each object in the list and displays in a
subfile.

The problem I ran into is that if the list has more than 9999 records it
blows up the subfile.

As I see it I have two choices; "page at a time" subfile or a UIM panel.

I know that a UIM panel would not have the 9999 record limitation and I
have used them.

I can see that a "page at a time" subfile works well for data from a
file, or "file like" source. I am struggling to figure out how best do
the same with the list api data in the user space.

I am thinking of cranking thru the list api and building a temp dtaq or
file to store the data then read from there to populate the "page at a
time" subfile. I worry about the performance having to essentially read
the data twice to show the first page.

I am not inclined to use the initial user space as I would have to keep
retrieving the object info for each page up/down request.

Bryan
--

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.