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



OH BOY!!!! ANOTHER CYCLE THREAD!!!!! WOOHOO!

I use the cycle for multiple field control break processing. The main
reason is that there is really only one way to do it using level break
indicators, while there are as many roll-your-own control break
techniques as there are programmers who write them.

I don't trust anyone else's roll-your-own control break routines, so
it doesn't bother me if they don't trust mine.

The thing is, it's fast, it's simple (once you learn a couple of
rules) and it does so much for you. rule one: at Lx detail time -
you currently have the first record in the group. rule two: at Lx
total time - you have just read and processed the last record of the
group and are _about_ to read the first record of the next group.
The data in your fields have not changed, so there is no reason to put
them into hold fields for printing group identifying data on your
subtotals.

When you are printing a report with detail and subtotals on change of
5 different fields, there is no better way of doing it.

In new development, I don't need to do the above very often, so I
probably haven't written more than one or two production programs
using the cycle in the last several years, but it's a tool in my bag,
and I'm not afraid to use it.

On Thu, Jan 8, 2009 at 1:06 PM, Aaron Bartell <aaronbartell@xxxxxxxxx> wrote:
Since I started programming in RPG about 10 years ago I have only ever
used the cycle if I was maintaining somebody elses app (I had to use it
about one month ago for a process that had an input primary read table
which sent XML transactions to another party). It threw me for a loop
initially because I didn't catch the P in the F spec, but once I
realized what was going on it worked just fine.

Now, in my mind I would have instead just created a READ/DO/READ/ENDDO
structure in the mainline of the program, but that is just opinion.
Outside of input primary read type programs where you process the entire
file, what other purposes are there where "the cycle is the best tool
for the job"? Asking out of complete ignorance because I am one that
rarely explicitly uses it (to my knowledge). Note I do have programming
that doesn't turn on *INLR and I am guessing that would be one of the
areas you would consider the cycle good? (and I would agree).

Aaron Bartell
http://mowyourlawn.com

Mark Walter wrote:
That's total bunk, brother. Sometime the cycle is the best tool for the job.

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of sjl
Sent: Thursday, January 08, 2009 12:13 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: Re: FW: Niftiest thing(s) you have done in RPG ILE or /FREE

Chris wrote:
As for ILE/RPG, the cycle is about as useful
as mammaries on a boar.

Chris -
I think I resemble that remark!
- sjl


--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



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.