MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Diff between continue & next sentence

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
mdisulaiman
Beginner


Joined: 14 Nov 2003
Posts: 17
Topics: 10

PostPosted: Sat Nov 15, 2003 9:17 am    Post subject: Diff between continue & next sentence Reply with quote

Hi All,

I am new to cobol pgm ,i want to know the diff between CONTINUE and
NEXT SENTENCE.


bye
_________________
sulaiman
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12370
Topics: 75
Location: San Jose

PostPosted: Sat Nov 15, 2003 11:06 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
mdisulaiman
Beginner


Joined: 14 Nov 2003
Posts: 17
Topics: 10

PostPosted: Sun Nov 16, 2003 3:16 am    Post subject: Reply with quote

Hi Kolusu,


Thanks for your info.
_________________
sulaiman
Back to top
View user's profile Send private message Send e-mail
DaveyC
Moderator


Joined: 02 Dec 2002
Posts: 151
Topics: 3
Location: Perth, Western Australia

PostPosted: Fri Nov 28, 2003 7:58 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group