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



I'm not fully awake, but it looks like the code only executes the code
for a single comparison.  If that's true, then select would work.  If
the value of action were changed in one of the if groups it would be a
different thing.  

I can't remember a situation where I've used leave or iter.  It's
probably because I was trained that way and developed coding habits that
avoid them. I am guilty of using return in procedures the way some
people use leave.

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of RPower@xxxxxxxxxx
Sent: Monday, January 31, 2005 9:16 AM
To: RPG programming on the AS400 / iSeries
Subject: Re: Suggested technique

What's wrong with the Iter and Leave op codes?  I've used them a lot in
the past, and will probably continue to do so in the future.  I don't
like the GOTO's and CAB's, but the LEAVE and ITER just make sense.
Especially in screen processing.  The following code is a looping
screen.  The ITER code helps when doing validation, and the LEAVE is a
simple way to get out.  How could you code this without using them?
BTW, this isn't my code, but I was looking real quick to find an example
lol.

      * Stay in loop until Cmd 1 is pressed
     c                   dow       not(*in01)
     c                   eval      action    = *blanks
     c                   eval      category  = *blanks
     c                   eval      descriptn = *blanks
     c                   exfmt     cbrdescdt
     c                   movea     '0000000'     *in(30)
      *
      * F5 will print report
     c                   if        *in05     = *on
     c                   eval      *in50     = *on
     c                   exsr      print
     c                   iter
     c                   endif
      *
      * Just a littl

*****************************
NOTICE:
All e-mail sent to or from this e-mail address will be received or otherwise 
recorded by
The Sharper Image corporate e-mail system and is subject to archival, 
monitoring,
and review by and/or disclosure to Sharper Image security and other management.
This message is intended only for the use of the addressee and may contain 
information
that is privileged and confidential.

The contents of this message may contain personal views which are not the views 
of The Sharper Image.
If you are not the intended recipient, dissemination of this communication is 
prohibited.
*****************************


As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.