version 1.130, 2004/09/05 07:46:08
|
version 1.131, 2004/09/13 07:32:37
|
Line 5182 CASE
|
Line 5182 CASE
|
@i{n2} OF @i{code2} ENDOF |
@i{n2} OF @i{code2} ENDOF |
@dots{} |
@dots{} |
( n ) @i{default-code} ( n ) |
( n ) @i{default-code} ( n ) |
ENDCASE |
ENDCASE ( ) |
@end example |
@end example |
|
|
Executes the first @i{codei}, where the @i{ni} is equal to @i{n}. If no |
Executes the first @i{codei}, where the @i{ni} is equal to @i{n}. If |
@i{ni} matches, the optional @i{default-code} is executed. The optional |
no @i{ni} matches, the optional @i{default-code} is executed. The |
default case can be added by simply writing the code after the last |
optional default case can be added by simply writing the code after |
@code{ENDOF}. It may use @i{n}, which is on top of the stack, but must |
the last @code{ENDOF}. It may use @i{n}, which is on top of the stack, |
not consume it. |
but must not consume it. The value @i{n} is consumed by this |
|
construction (either by a OF that matches, or by the ENDCASE, if no OF |
|
matches). |
|
|
@progstyle |
@progstyle |
To keep the code understandable, you should ensure that on all paths |
To keep the code understandable, you should ensure that you change the |
through a selection construct the stack is changed in the same way |
stack in the same way (wrt. number and types of stack items consumed |
(wrt. number and types of stack items consumed and pushed). |
and pushed) on all paths through a selection construct. |
|
|
@node Simple Loops, Counted Loops, Selection, Control Structures |
@node Simple Loops, Counted Loops, Selection, Control Structures |
@subsection Simple Loops |
@subsection Simple Loops |