View previous topic :: View next topic
|
Author |
Message |
skandanuru
New User
Joined: 18 Apr 2007 Posts: 1 Location: India
|
|
|
|
If I have a code like
MOVE 01 TO WS-COUNT
PERFORM PARA-1 WS-COUNT TIMES
PARA-1.
DISPLAY ' HI '
ADD +1 TO WS-COUNT
IF WS-COUNT > 10
GO BACK
END-IF.
Howmany times 'HI' will get displyed?
Whether 1 time or 10 times
Since the value of WS-COUNT is getting increased by 1 each time. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
test it yourself................... |
|
Back to top |
|
|
Gnanas N
Active Member
Joined: 06 Sep 2007 Posts: 792 Location: Chennai, India
|
|
|
|
Once |
|
Back to top |
|
|
acevedo
Active User
Joined: 11 May 2005 Posts: 344 Location: Spain
|
|
|
|
yes, once OF COURSE.
Quote: |
MOVE 01 TO WS-COUNT
PERFORM PARA-1 1 TIMES
|
|
|
Back to top |
|
|
shitij
New User
Joined: 09 Sep 2005 Posts: 31 Location: Delhi
|
|
|
|
U have coded:
Code: |
MOVE 01 TO WS-COUNT
PERFORM PARA-1 WS-COUNT TIMES |
That means:
Code: |
MOVE 01 TO WS-COUNT i.e. (WS-COUNT=1) |
Now u tell the code to:
Code: |
PERFORM PARA-1 WS-COUNT TIMES
i.e. PERFORM PARA-1 01 TIMES |
Therefore it will perform only once.
Regards,
Shitij |
|
Back to top |
|
|
|