This file contains a description of the features of the NeoBasic language.

컴컴컴컴컴컴컴컴컴컴컴
 PROGRAM FLOW CONTROL
컴컴컴컴컴컴컴컴컴컴컴

SELECT CASE:

Schematic structure:

    SELECT CASE testexpression
    CASE [IS <rel op>] expression1
         [statementblock1]
         [STAY]
    [CASE [IS <rel op>] expression2
         [statementblock2]]...
         [STAY]
    [CASE ELSE
         [statementblock]]
    END SELECT


Description:

The SELECT CASE statement allows you to define the actions to take
depending on the value of an expression. The 'testexpression'is evaluated
and stored in a temporary variable.

For each given CASE the 'testexpression' result is compared to the result of
an expression given after CASE. By default an equality test is executed.
The test- and case results can also be compared with another relative operator
(that is, one of  > >= <> <= < =  ) if CASE is followes by IS and the relative
operator.
If the result of this comparison is "true" then the statement block between
the current case and the next case (or END SELECT) is executed. If not, then
the statement block after this code is skipped, and the next case (if there
is one) is evaluated.
The last CASE in the SELECT CASE block may have ELSE after it, instead of an
expression. This CASE is executed if all other cases are not met.
The SELECT CASE block will be departed if an EXIT SELECT is encountered
during execution.
If the last statement in a CASE statementblock is STAY, then the code in the
statementblock of the next case is executed as well. If it is not STAY, then
all other cases are skipped, and thus execution continues after the end of the
select case block.


Details:

   STAY is added to "make a bridge" between the C's switch and BASIC's select.
In C, the switch is not automatically exited at the end of a case statement-
block. One has to put "break" at the end of this block to leave the switch.
If not, execution continues in the next case block, without any checking of
test- and case values. This can be very handy sometimes, if you wish to do
the same things in a couple of cases, but in one of these something
additional. STAY adds this feature to basic.


Differences with Microsoft BASIC's:

    NeoBasic does not yet support a list of possible values in which case
the same CASE statementblock must be executed. Also, it doesn't allow a check
whether the testresult is within a range of values (e.g. CASE 1 TO 10). These
features are planned to be supported in future versions.
On the other hand MS basic's do not know EXIT SELECT and STAY likes.

