View previous topic :: View next topic
|
Author |
Message |
satish.ms10
Active User
Joined: 10 Aug 2009 Posts: 184 Location: India
|
|
|
|
Hi All,
I have following code in one of my PL/I programs,
Code: |
DO J = 0, COMPCODE;
TEMP(J) = TEMP(J) + CSPREM;
TEMP1(J) = TEMP1(J) + CSCOMP;
TEMP2(J) =TEMP2(J) + WRCOMP;
END; |
Someone please explain me how this DO loop is going to stop iterations?
Thanks in advance. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
Back to top |
|
|
satish.ms10
Active User
Joined: 10 Aug 2009 Posts: 184 Location: India
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
I mis-read your code. . .
Did you try the code? What happened?
Also, please note that the link you gave does not point to the intended documentation page. If you mouse-over the link you can see where it really points. Let me know and i'll fix this.
Corrected in the original post |
|
Back to top |
|
|
satish.ms10
Active User
Joined: 10 Aug 2009 Posts: 184 Location: India
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
You're welcome
Quote: |
Sorry for the inconvenience |
Not to worry. I caused more inconvenience than you did. . .
I don't have access to a pl/i compiler, so i didn't test either. . .
Hopefully, one of the pl/i folks will confirm our understanding. |
|
Back to top |
|
|
Srihari Gonugunta
Active User
Joined: 14 Sep 2007 Posts: 295 Location: Singapore
|
|
|
|
Satish,
This loop is executed twice. first time J value is 0 and second time with a value from COMPCODE.
For better understanding consider this.
DO J=0,1,2,3,4;
END;
Above loop will execute five times with J using the supplied values 0,1,2,3,4.
Hope this helps. |
|
Back to top |
|
|
|