[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gnubol: IBM - Conditionals and Scope Terminators (implicit or otherwise)



Well, honestly, I don't see nearly enough langauage in those three
paragraphs to say all that.  Perhaps you had some notion of what it
_must_ be saying.

I'll let Bob speak for himself if he wants to.  My reading was "These
are the rules but the compiler does not enforce them."  

Of course, I do not deny that I had some notion about what it _must_
be saying, too.



>>>>> "Bill" == William M Klein <wmklein@ix.netcom.com>
>>>>> wrote the following on Sat, 4 Dec 1999 18:00:16 -0600

  Bill> (Tom or Robyn - can you comment on my view in the
  Bill> following. Obviously, if - as this coming from the GNU
  Bill> project - it makes this a "conflict of interest" - please do
  Bill> not comment - but it is an issue of what YOUR documentation
  Bill> means.)

  Bill> I believe (but won't swear to it) that taken together, what
  Bill> these 3 paragraphs mean is:

  Bill> 1) The following is illegal

Add 1 to A
   On Size Error
     Add 1 to B
       On Size error
         Display "illegal"
   .

  Bill> Because the nested statement is conditional - where an
  Bill> imperative is REQUIRED (the period does not change the nature
  Bill> of the NESTED statement).

  Bill> 2) If you have

 If A = B
   Add 1 to A
      On Size Error
         Display "OK"
 Else
    Display "OK"
 .

  Bill> it is EQUIVALENT to

 If A = B
   Add 1 to A
      On Size Error
         Display "OK"
   End-Add
 Else
    Display "OK"
 .

  Bill> because an "implicit scope terminator" is inserted before the
  Bill> ELSE (phrase from containing statement) to terminate the
  Bill> conditional statement WHERE IT IS ALLOWED by the Standard.

  Bill> 3) The following *IS* illegal

 If A = B
   Add 1 to A
      On Size Error
         Add 1 to B
           On Size Error
              Display "illegal"
 Else
    Display "It's a no-no"
 .

  Bill> because the 2nd add is STILL a conditional (where an
  Bill> imperative is required) and that even adding a SINGLE
  Bill> "END-ADD" before the Else wouldn't solve the problem *IF* it
  Bill> were matched with the 1st nested IF (not the 2nd - which is
  Bill> what would happen by the "implicit scope terminator rule).

  Bill>   ***

  Bill> Does this agree with either of you?  Does it make sense (from
  Bill> the documentation referenced?)




--
This message was sent through the gnu-cobol mailing list.  To remove yourself
from this mailing list, send a message to majordomo@lusars.net with the
words "unsubscribe gnu-cobol" in the message body.  For more information on
the GNU COBOL project, send mail to gnu-cobol-owner@lusars.net.