I suppose so, but I always use SELECT, never ELSEIF.  I think it's because with 
ELSEIF I feel compelled to indent each clause as if it were an "ELSE IF", and I 
abominate those long increasingly indented constructions:

  if expr1 then stm1
  else if expr2 then stm2
    else if expr3 then do
        blah blah blah; end
      else if expr4 then stm4
        else if expr5 then stm5

SELECT allows me to avoid that.

I love the iterate statement for much the same reason:

  do queued()
    parse pull rid data
    if abbrev(rid,'*') then iterate
    if data='' then iterate
    if datatype(data)<>'NUM' then iterate
    /* NOW I can do what I wanted. */
    end

I'm so enamored with it that I simulate it in VBA:

    For jr = 1 To LastRow(ows)
      If Left(ocs(jr, 1).Value,1) = "*" Then GoTo IterateRow
      If ocs(jr,2).Value = "" Then GoTo IterateRow
      If Not IsNumeric(ocs(jr,2).Value) Then GoTo IterateRow
      ' NOW I can do what I wanted.
  IterateRow:
      Next jr

(For VBA programmers:  I wouldn’t actually write it this way.  Testing reveals 
that VBA takes about ten times as long to look up object.property as to 
retrieve a scalar variable.  So if I'm using ocs(jr, 2).Value more than once, 
I'd always put it in a variable first and then use the variable.)

---
Bob Bridges, [email protected], cell 336 382-7313

/* Extraordinary afflictions are not always the punishment of extraordinary 
sins, but sometimes the trial of extraordinary graces.  Sanctified afflictions 
are spiritual promotions.  -Matthew Henry (1662-1714) */

-----Original Message-----
From: IBM Mainframe Discussion List <[email protected]> On Behalf Of 
Paul Gilmartin
Sent: Wednesday, March 29, 2023 09:01

Isn't SELECT (I know Rexx, not PL/I) just an ELSEIF chain?

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to