×
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.
Understanding the cycle is only important if your specific employer has programs that use it. I haven't seen one for years. No point in memorizing something that you aren't going to use. There are much more maintainable ways in RPG to do almost everything the cycle does, and you can use a modern report writer for everything else.
Mark Murphy
Atlas Data Systems
mmurphy@xxxxxxxxxxxxxxx
-----"James H. H. Lampert" <jamesl@xxxxxxxxxxxxxxxxx> wrote: -----
To: "RPG programming on the IBM i (AS/400 and iSeries)" <rpg400-l@xxxxxxxxxxxx>
From: "James H. H. Lampert" <jamesl@xxxxxxxxxxxxxxxxx>
Date: 04/27/2017 12:43PM
Subject: Re: New to RPG
The only thing I can think of to add is this:
DON'T BE AFRAID TO TAKE A RIDE ON "THE CYCLE."
Because of RPG's history (it's name means "Report Program Generator"),
it's designed to process entire files, and as such, every RPG program
(unless, in the more recent versions of RPG, you explicitly disable it)
runs inside an implicit "DO UNTIL *INLR = TRUE" loop, and if you
designate a file as the "Primary File," each iteration of that implicit
do-loop begins with a read operation on that file, raising the "LR"
indicator when the last record of the file is read.
If you designate a Primary File, then The Cycle allows you to "ride"
through the file, processing each record in sequence, instead of having
to "walk" through it.
And if you don't designate a Primary File, then The Cycle can be used as
a built-in event loop for an interactive program: all you need to do is
raise the LR indicator whenever the user is ready to exit.
If you don't have a use for The Cycle in a given program, then you need
to either disable it explicitly, or else make sure LR gets raised.
WHAT YOU DO NOT WANT TO DO IS IGNORE "THE CYCLE." If you ignore The
Cycle, it will run over you.
--
JHHL
As an Amazon Associate we earn from qualifying purchases.
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.