Howard Brazee wrote:
On 13 Oct 2008 08:55:24 -0700, in bit.listserv.ibm-main you wrote:

IF WC-FUNC (SUB) = "X" OR WC-FUNC (SUB) = "Z"
   IF WC-AMTUSE (SUB) + WC-AMT-PENDING (SUB) < ZERO
       GO TO G100-FIND-CREDIT-X
   END-IF
END-IF.


And I would use
 IF WC-FUNC (SUB) = "X"
 OR WC-FUNC (SUB) = "Y"

This makes it easier to comment out the OR line.

I would use:

IF WC-FUNC (SUB) = "X"
               OR "Y"

Of course I think that the original one had an AND instead of the separate IF statement above, so if I went that way it would still require parens:

IF (WC-FUNC (SUB) = "X"
                OR "Y")
AND (WC-AMTUSE (SUB) + WC-AMT-PENDING (SUB) < ZERO)

(Parens not required after the AND, but probably useful.)

I'm glad to see I'm not the only one who prefers the connectors (AND / OR) at the beginning of a line for exactly the reason you mention. I tried to convince a co-worker of the use of this recently, but he simply would not budge!

I still think that
IF WC-FUNC (SUB) = "X"
               OR "Y"
AND WC-AMTUSE (SUB) + WC-AMT-PENDING (SUB) < ZERO

should bind as IF (WC-FUNC (SUB) = "X" OR WC-FUNC (SUB) = "Y") AND (WC-AMTUSE (SUB) + WC-AMT-PENDING (SUB) < ZERO), because I would guess it would always be what one means. But IIRC it binds as IF WC-FUNC (SUB) = "X" OR (WC-FUNC (SUB) = "Y" AND WC-AMTUSE (SUB) + WC-AMT-PENDING (SUB) < ZERO), which is where things go awry. Ah well. Maybe when I create my own language... :-)

Frank

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to