Re: Is it always possible to write a COBOL program using only 1 sentence per paragraph?




"Richard" <riplin@xxxxxxxxxxxx> wrote in message
news:1121117821.011458.183950@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> I can. It has been recently argu^H^H^H discussed here that a NEXT
> SENTENCE embedded in a nested imperitive IF is allowed (some even think
> it was deliberately allowed) and this will transfer control to after
> the next full stop which may be at some arbitrary point.
>
> In my view any such usage should cause the converter to put the output
> and input to /dev/nul, and preverably the coder as well, but it does
> mean that such a program cannot have that full stop removed.

Hmm, interesting. I did not find any mention of "NEXT SENTENCE" in any
of the documentation I initially used as references for the COBOL language,
but based on the discussions I've found on the web, it looks like NEXT
SENTENCE is an unconditional jump to the statement immediately following the
period of the sentence containing the NEXT SENTENCE statement, as you've
said.

I think this would be one one case where I would have to add a new
paragraph name (to act as a label), then change the NEXT SENTENCE to a GO TO
which jumps to that label. All the while, I have to be check for any PERFORM
or PERFORM THRU statements that I might have to update to reflect the
addition of this new paragraph.

Thanks for the tip, I might have to factor in this new issue into the
algorithm design.

- Oliver.


.



Relevant Pages

  • Re: COBOL aint quite dead - yet !
    ... Putting in a paragraph label is a lightweight ... The style of having 3 labels and an EXIT for everything ... paragraph label would end the perform while a comment line would not. ... said "the correctness of the program in following the style". ...
    (comp.lang.cobol)
  • Re: COBOL aint quite dead - yet !
    ... sometimes I will replace the EXIT. ... was via the last paragraph. ... In Cobol a label may be the target of a goto, a perform, a drop ...
    (comp.lang.cobol)
  • Re: Perform Thru/Go to vs. Perform - Compile Speed
    ... an end paragraph label, they alloacte a new prefix number to indicate ... quarter century) text serches will find any name so prefixes are not ... that may be because you would still use 'heavyweight' ...
    (comp.lang.cobol)
  • Re: Labels-single spacing - how to make default Word 2007
    ... You should modify your Normal style and set it back to the original defaults ... Then, create a new document based on your Normal template, display ... before each paragraph and 0.08" left and right indent. ... What I'd recommend is to set up a template for each label definition you use ...
    (microsoft.public.word.pagelayout)
  • Re: COBOL aint quite dead - yet !
    ... sometimes I will replace the EXIT. ... the exactly the same label made into a comment. ... Putting in a paragraph label is a lightweight ... possibility of errors such as goto the wrong one, ...
    (comp.lang.cobol)