× 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: page n of x
  • From: Gary Guthrie <GaryGuthrie@xxxxxxxx>
  • Date: Wed, 13 Sep 2000 10:28:16 -0500

Rather than worry about the size of the user space, why not increment a
counter each time you make a replacment (increment after the
replacement) and compare the counter to the number of pages. When
they're equal, you're finished.

Will that be suitable?

Gary Guthrie
REAL Solutions Technical Support
NEWS/400 Technical Editor


P.S. - Please be aware that the code was for a series of articles. It
was sample code only. I mention this because it doesn't handle a
situation where the spooled file is so large it won't fit in one user
space. Of course, that's a pretty hefty spooled file usually. If you
need to work with these gigantic spooled files, you'll need to modify
the utility to work with multiple user spaces. Enjoy.



> On Wed, 6 Sep 2000, Gary Guthrie wrote:
> 
> > You can head over to The RPG Source website (
> > http://www.as400network.com/TheRPGSource ) and click on Download
> > Utilities. There you'll find the routines you need. Off the top of my
> > head, I don't remember everything you need, but you at least need:
> >
> > SplFAPI
> > SpcAPI
> 


James David Rich wrote:
> 
> I did just this and now I am close to completing this project.  Now the
> problem I have is how to detect when I am at the end of the user space
> that holds the spooled file?
> 
> Here's what happens:
> 
> 1. I run the program the generates the lovely report on which I need to
> put the total number of pages.  Right now as the report runs it puts 'Page
> n of ~~~~', where n is the current page number.
> 
> 2. I then use the source code mentioned above to copy the spool file to a
> user space.
> 
> 3. I then get a pointer to the user space and scan for ~~~~, replacing it
> with the total number of pages.
> 
> 4. Then I use the source above to copy the modufied user space to a spool
> file and print.  Presto change-o!
> 
> The problem is knowing when to stop incrementing the pointer to the user
> space.  I need something to tell me the size of the user space.  Any
> ideas?
> 
> James Rich
> james@dansfoods.com
> 
> +---
> | This is the RPG/400 Mailing List!
> | To submit a new message, send your mail to RPG400-L@midrange.com.
> | To subscribe to this list send email to RPG400-L-SUB@midrange.com.
> | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
> | Questions should be directed to the list owner/operator: david@midrange.com
> +---
+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-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 ...

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.