Difference between CONTINUE and NEXT SENTENCE

4 posts / 0 new
Last post
Anonymous
Difference between CONTINUE and NEXT SENTENCE

 

 

 

 

What is the difference between CONTINUE and Next Sentence?

"; ; ; ;
Offline
Joined: 07/07/2011 - 19:59
The next sentence command

The next sentence command does exactly what it says, it goes to the next sentence which follows after the next full stop. The continue command starts executing at the next Statement.

In COBOL a statement is not a sentence, Sentences are separated by full stops.

My personal coding standard is never to code full stops in my programs except at the end of a paragraph on a line of it's own. Also banned is the next sentence clause.

By coding in this way all confusion between next sentence and continue is eliminated.

Here is some pseudo code to demonstrate the difference:

Evaluate a
when 1
continue
when 2
next sentence
end-evaluate

next-statement-continues here.
next-sentence.

Offline
Joined: 08/08/2011 - 11:32
difference between continue and next sentence
continue and next sentence are used when IF is empty continue executes the next logical statement. next sentence executes the next statement after the period. EXAMPLE: IF GENDER = 'M' CONTINUE/NEXT SENTENCE ELSE MOVE 1000.00 TO BONUS-AMOUNT END-IF MOVE A TO B. MOVE C TO D. continue executes MOVE A TO B. next sentence executes MOVE C TO D.
Anonymous
RE:Difference between CONTINUE and NEXT SENTENCE

 

CONTINUE is like a null statement (and does nothing) , while NEXT SENTENCE transfers control to the next sentence (i.e. to the
next statement ending with period)
Log in or register to post comments
Sponsored Listing