Don't know if anyone in the discussion has ever written any of IBM's early RPG 
(note that the options are still in the RPG/400 for the ILE, too, . . .DO NOT 
USE THEM!), but RPG instructions (known as "calculation" or "C" specs. -- 
nothing to do with the C programming language) have a throw-back conditional 
feature known as left hand indicators, three of them per instruction, actually, 
that can be set in a variety of boolean states to determine whether the line of 
code is to be executed or not.  These indicators are boolean switches that can 
be set on or off (i.e., true or false) elsewhere in the code.  As I mentioned, 
these are throw-backs to the days when the IBM S/3x family of machines was 
emerging out of the 1410 transistor and 360 mainframe (360 Macro Assembler with 
JCL, RPG was and the acronym still stands for "Report Program Generator",. . 
.but that's another story).  Regardless, a few lines of RPG pseudo-code might 
look something like this

N01 23 N04              DO-Until. . .
N24 25                  goto somewhere else
 45                     perform a subroutine
 56                     if something is equal to something
                        then set indicator 56 off
    72                  end-if 
    71                  end-do

This reads as, "If indicator  01 was not set-on somewhere, and if indicator 23 
was set-on somewhere, and indicator 04 was not set-on somewhere, then DO 
something until some condition is met, but oh-by-the-way, while you're in this 
do-loop, if indicator 24 is not on and indicator 25 is on, then go somewhere 
else, all the time, keeping in mind that if indicator 24 is turned on, or 
indicator 25 is turned off, then don't go somewhere, . . .also, if indicator 45 
is on, then perform a subroutine while keeping in mind that the performed 
subroutine could also have similar instructions in it, too); indicator 56 must 
be on for a conditional "if true" scenario is to prevent itself from executing 
again; and as a final aggrevation, that final "enddo" doesn't count unless 
indicator 71 is on, similarily indicator 72 conditions the end-if.  

I'm sure that I've missed some other scenarios, but my point is that this is as 
EVIL as it gets, or pretzel-logic at it's "best"?

OTTF,
Ron W.

P.S.  In defense of RPG, If's, Do's and While's were not features of RPG-PH 
(pre-historic)

--------------------------------------------------------------------------------

  ----- Original Message ----- 
  From: Chris Devers 
  To: Charles K. Clarkson 
  Cc: Perl Beginners List 
  Sent: Thursday, January 06, 2005 6:24 AM
  Subject: RE: Is GOTO evil?

Reply via email to