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



Guess I should read the whole thread before replying LOL...that's what I
get for being away from the list for 2 days... 


Thanks,
Tommy Holden


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Holden Tommy
Sent: Thursday, March 01, 2007 9:23 AM
To: RPG programming on the AS400 / iSeries
Subject: RE: CHAIN Versus SETLL and READ When Data Needed

I hope an IBMer will chime in on this... 


Thanks,
Tommy Holden


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Chris Pando
Sent: Wednesday, February 28, 2007 4:04 PM
To: RPG programming on the AS400 / iSeries
Subject: Re: CHAIN Versus SETLL and READ When Data Needed

On 2/28/07, rob@xxxxxxxxx <rob@xxxxxxxxx> wrote:
Yes, actually, it is too much to expect.  I tried to follow that rule
but
it got too ugly with nested if's and stuff to put logic around each
part
to see if it's time to exit
Dou KissOff;
 if this;
   //
 else;
   //
 EndIf;
 If not KissOff;
   if ...;
     //
   EndIf;
 EndIf;
 If not KissOff;
   If ...;
     //
   EndIf;
 EndIf;
 If not KissOff;
   If ...;
     //
   EndIf;
 EndIf;
EndDo;


I have to deal with similar circustances all the time - as an example, I
have
a program with ten (10) consecutive procedures to execute. If any of
them
fail, I want to stop processing.

I create an array (@procProxy@) containing pointers to the procedures,
each of which returns KissOff.

I then create a proxy procedure (procProxy) based upon the procedure
pointer
procProxy@.

Then my code looks like this:

$I = 0;
DoU ( KissOff Or $I = %Elem(@procProxy@) );
  $I = $I + 1;
  procProxy@ = @procProxy@($I));
  KissOff = procProxy();
EndDo;


The Do loop has a true invariant, and GOTOs aren't necessary.


Chris "IMHFO" Pando
--
chris@xxxxxxxxx           | Every normal man must be tempted at
www.pando.org             | imes to spit on his hands, hoist
                          | the black flag, and begin slitting
                          | throats. H. L. Mencken

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.