View previous topic :: View next topic |
Author |
Message |
mdisulaiman Beginner
Joined: 14 Nov 2003 Posts: 17 Topics: 10
|
Posted: Sat Nov 15, 2003 9:17 am Post subject: Diff between continue & next sentence |
|
|
Hi All,
I am new to cobol pgm ,i want to know the diff between CONTINUE and
NEXT SENTENCE.
bye _________________ sulaiman |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12370 Topics: 75 Location: San Jose
|
Posted: Sat Nov 15, 2003 11:06 am Post subject: |
|
|
mdisulaiman,
NEXT SENTENCE lets you resume execution at the statement after the next period.
CONTINUE lets you resume execution after the next end of scope(End-if, End-evaluate , End-search , End-read ..).
ex:
Code: |
IF A = B
NEXT SENTENCE
ELSE
IF A > B
CONTINUE
ELSE
ADD 10 TO A
END-IF
ADD 1 TO B <===== CONTINUE STARTS EXECUETING HERE
END-IF.
READ INPUT FILE <=== NEXT SENTENCE STARTS EXECUETING HERE
|
Note the continue will resume execuetion after the scope-delimiter (end-if) whereas the next sentence resumes execuetion after the period(.)
Hope this helps...
cheers
kolusu |
|
Back to top |
|
|
mdisulaiman Beginner
Joined: 14 Nov 2003 Posts: 17 Topics: 10
|
Posted: Sun Nov 16, 2003 3:16 am Post subject: |
|
|
Hi Kolusu,
Thanks for your info. _________________ sulaiman |
|
Back to top |
|
|
DaveyC Moderator
Joined: 02 Dec 2002 Posts: 151 Topics: 3 Location: Perth, Western Australia
|
Posted: Fri Nov 28, 2003 7:58 am Post subject: |
|
|
IMO both are brain-dead constructs and I can't understand why anybody would want to use them. Why not just negate the test?
Code: |
IF A NOT = B
IF A NOT > B
...
END-IF
END-IF
|
_________________ Dave Crayford |
|
Back to top |
|
|
|
|