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



What is the advantage over:

C  dou  cmd3 or cmd12
         ....
 select
 when cmd3
 exsr endpgm

 when cmd12

 when cmd4
 exsr prompt

 when pagedown
 exsr loadpage

 other
 exsr edit
 if errors = NO
 exsr update
* leave (maybe a leave here, but not my style.)
 endif
 endsl

and delete each of the leave & iter lines?

What am I not seeing?



rick baird wrote:
I use infinate loops in one instance, and one instance only.

my subfile processing template program looks something like this (psuedocode)

-----
begsr

exsr inzsfl
exsr loadpage

dow 1=1
exfmt screen

select
when cmd3
exsr endpgm
leave

when cmd12
leave

when cmd4
exsr prompt
iter

when pagedown
exsr loadpage
iter

other
exsr edit

if errors
iter
end

exsr update
leave
endsl

enddo

endsr
----

because sometimes of so many different reasons to iter or leave, I
don't want my loop dependent on some nebulous variable that I have to
declare, set and change depending on how I want the loop to behave.

adding command keys or functions is simple - just another when section
- very predictable behavior.

iterate or leave.  no worries, no hassles, no ambiguity, no errors no
declaring variables.

jmho.


On 9/14/06, Booth Martin <booth@xxxxxxxxxxxx> wrote:
I happen to like "dou 'dog' = 'cat' because it immediately tells the
programmer something infinite is happening here.

However, in my experience, an infinite loop usually means a broken
thought process.  There is a need for infinite loops, but not very
often, in my opinion.

*ducking*

rob@xxxxxxxxx wrote:
If you notice, they refer you to FOR.  You might try
for x = 1 to *hival;
but you'd have to define x and then I'd wonder what about internal
precision, etc.  For example, if x was defined as 1,0, what happens when x
goes over 9?


Rob Berendt
--
-----------------------------
Booth Martin
www.martinvt.com
-----------------------------
--
This is the RPG programming on the AS400 / iSeries (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.