Re: newbie question on cobol syntax



"Howard Brazee" <howard@xxxxxxxxxx> wrote in message
news:1hhp23lrbejcmn16429hp0pthh40pmn5fn@xxxxxxxxxx
On Sun, 22 Apr 2007 23:52:11 GMT, "William M. Klein"
<wmklein@xxxxxxxxxxxxxxxxx> wrote:
<snip>

Some compilers will allow

If Field-1 = A
Next Sentence
Else
Display "Here"
End-IF

Display "There".

In which case "Next Sentence" still goes to the next sentence. I
see no advantage in ever using NEXT SENTENCE now that CONTINUE is
available.


Howard,
I know that you know this, but just in case some "newbie" (see subject line
doesn't) this is the reason that understanding Next Sentence vs Continue is
importaat (if your compiler supports this extension).

If Field-1 = A
Next Sentence
Else
Display "Here"
End-IF
Display "There"
.
Display "Some Place Else
.
Display "Still another logic branch
.

yields different results from

If Field-1 = A
Next Sentence
Else
Display "Here"
End-IF
Display "There"
* no period
Display "Some Place Else
.
Display "Still another logic branch
.

And neither of the above is the same as

If Field-1 = A
Continue
Else
Display "Here"
End-IF
Display "There"
.
Display "Some Place Else
.
Display "Still another logic branch
.

* * * * *

As most people (but not all) agre, "mixing" next sentence with scope delimiters
is NOT a good thing to do.

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


.



Relevant Pages

  • Re: abortive exiting
    ... PROCEDURE DIVISION USING FIELD-1. ... DISPLAY MY-RECORD ... IF NOT FILE-SUCCESSFUL ... Flag is set automatically. ...
    (comp.lang.cobol)
  • Re: abortive exiting
    ... PROCEDURE DIVISION USING FIELD-1. ... DISPLAY MY-RECORD ... OPEN INPUT MY-FILE ... IF NOT FILE-SUCCESSFUL ...
    (comp.lang.cobol)
  • Re: abortive exiting
    ... PROCEDURE DIVISION USING FIELD-1. ... DISPLAY MY-RECORD ... OPEN INPUT MY-FILE ... IF NOT FILE-SUCCESSFUL ...
    (comp.lang.cobol)
  • Re: newbie question on cobol syntax
    ... a NEXT SENTENCE phrase (or statement - if your compiler has such a statement as ... an extension - as Micro Focus does) will "go to". ... If Field-1 = A ... Display "There" ...
    (comp.lang.cobol)
  • Re: About index variable in cobol
    ... Before someone tells you to do your own homework, ... Bill Klein ... wmklein ix.netcom.com ... How to display the value of an index variable? ...
    (comp.lang.cobol)