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

Re: gnubol: "Illegal" Next Sentence



You're getting to be a very likable fella, Bill.  I still think it's
too bad you had that bad experience with nested conditionals at
MicroFocus, but you got this one right.

I winced and stuck in an ugly hack to be able to warn on the NEXT
SENTENCE thing, because that was better and much easier than starting
another interminable thread about it.

Your copy trick, if nothing else, demonstrates that it was a pretty
silly rule in the first place.

Best regards,

Mike


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

  Bill> The topic of "illegal" Next Sentence (i.e. a Next Sentence in
  Bill> an IF with an END-IF or a SEARCH with an END-SEARCH) is one
  Bill> of those areas that gets into "religious wars" among COBOL
  Bill> people.

  Bill> I'll start with a warning, I happen to be on the side for
  Bill> ALLOWING "NEXT SENTENCE" in constructs with
  Bill> scope-terminators.  This was (explicitly) allowed in the JOD;
  Bill> is allowed as a documented (and flagged) extension by Micro
  Bill> Focus, IBM, and a variety of other vendors.

  Bill> Having said that, the entire "NEXT SENTENCE" construct is
  Bill> being put into the (new) category called "archaic" in the
  Bill> draft Standard, and I do fully understand that it is
  Bill> error-prone (at least when you don't understand how DIFFERENT
  Bill> "continue" and "next sentence" are).  Therefore, if you all
  Bill> are going to be "legalistic" and enforce the ANSI rule on it,
  Bill> I won't fight too hard for the extension.

  Bill> I do want to point out one thing about "illegal" next
  Bill> sentences - that you may not realize (but which was confirmed
  Bill> by a J4 interpretation request).  If you really WANT to use
  Bill> "Next Sentence *logic*" you can in every conforming
  Bill> implementation.  All you need to do is:

  Bill> A) Create a variable in Working-Storage (that you never
  Bill> modify in your procedure division - i.e. a constant)

  Bill>   01 Next-Sentence Pic X Value Space.

  Bill> B) Create a COPY member called NextSentence which has the
  Bill> following code in it:

  If Next-Sentence = Space
    If Next-Sentence = Space
        Next Sentence
    Else
        Continue
  Else
     Continue
  End-IF

  Bill>    ***

  Bill> That copy member can be copied into any place in your
  Bill> Procedure Division (even in an IF with an END-IF - or a
  Bill> SEARCH with an END-SEARCH) and create absolutely conforming
  Bill> source code - that does a NEXT SENTENCE. (Let me know if you
  Bill> need "chapter and verse" on why it is conforming - but it
  Bill> is.)

  Bill> Bottom-Line: My suggestion (but I won't fight too hard for
  Bill> it) is to just let a NEXT SENTENCE be used whether or not the
  Bill> construct has a scope terminator.

  Bill> Bill Klein wmklein <at> ix.netcom.com


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




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