View previous topic :: View next topic
|
Author |
Message |
dipanshu
New User
Joined: 16 Jan 2006 Posts: 53 Location: pune
|
|
|
|
Is there any verb in cobol which break the loop when some condition got satisfied just like in c language is BREAK
can we use refrence modifier with array element , if yes pls send me the syntax. |
|
Back to top |
|
|
itssreehere Warnings : 1 New User
Joined: 10 Jan 2006 Posts: 65 Location: chennai
|
|
|
|
1)i think 'next sentence' will take you out the loop.
2) yes you can use reference mod with rray elements.
array-item(index)(1:3)
Sreejith |
|
Back to top |
|
|
dipanshu
New User
Joined: 16 Jan 2006 Posts: 53 Location: pune
|
|
|
|
NEXT and CONTINUE both have the same function , i know we can use GO TO verb for this problem but i m searching for alternative is there any?
Next is not possible dear. |
|
Back to top |
|
|
itssreehere Warnings : 1 New User
Joined: 10 Jan 2006 Posts: 65 Location: chennai
|
|
|
|
next sentence and continue are not the same. If there is only one loop both are same.If you are in a multiple loop next sentence will come out of all the loops, while continue will come out of the current loop.
Sreejith |
|
Back to top |
|
|
ankursanghi
New User
Joined: 19 Jul 2005 Posts: 4
|
|
|
|
I don't think that even continue takes you out of the loop, it will just advance the loop further.
But in case of Next Sentence, it will take you after the first dot (.) that it encounters. |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Hi dipanshu,
The various PERFORM clauses should give what you need to break a loop. Read the COBOL Reference manual for the details. |
|
Back to top |
|
|
pghogan3
New User
Joined: 25 Jul 2006 Posts: 1
|
|
|
|
What would be the result of performing a paragraph-1 thru paragraph-2 (which has only the EXIT statement ) with paragraph-1 containing an in-line PERFORM including IF tests, some of which GO TO paragraph-2 ?
The current result seems to be that the program drops thru to the next line following the EXIT (as if it weren't set). |
|
Back to top |
|
|
chiranjeevi_mca
New User
Joined: 19 Feb 2006 Posts: 27
|
|
|
|
hi,
NEXT keyword beaks the loop.
CONTINUE will skip that time and once again transfer the control to the same loop once again |
|
Back to top |
|
|
|