View previous topic :: View next topic
|
Author |
Message |
ys_more
New User
Joined: 21 Jun 2005 Posts: 5
|
|
|
|
Hi ,
what will be o/pf following.
x =4
EVALUATE TRUE
WHEN X<5
DISPLAY " LESS THAN 5"
WHEN X>3
DISPLAY " GREATER THAN 3"
END-EVALUATE.
DO WE WILL GET BOTH THE MESSAGES OR WE COME OUT OF EVALUATE WHEN A CONDITION GET SATISFIED FOR THE FIRST TIME.
ANOTHER Query
What is diffrence between NEXT STATEMENT AND CONTINUE , IF POSSIBLE TRY TO EXPLAIN IN CONTEXT OF EVALUATE STATEMENT. |
|
Back to top |
|
|
kanak
Moderator
Joined: 12 Mar 2005 Posts: 252 Location: India
|
|
|
|
Control comes out of the Evaluate -When once one condition is satisfied. Hence you will be getting output as "LESS THAN 5"
Difference between NEXT statement and CONTINUE is
Next statement executes next statement after first available period. Where as continue is just next statement.
For example
Code: |
COMPUTE X = A + B
EVALUATE X
WHEN 3
NEXT STATEMENT
WHEN 4
CONTINUE
END-EVALUATE
ADD 5 TO X.
DISPLAY X.
|
When x will be 3 then it will display 3 where as when it is 4 then it will display 9. Hope this will clear your doubt in some extent.
Correct me if i am wrong. |
|
Back to top |
|
|
|