=====================================================================

The switch statement is used when you wish to make a series of tests
on a variable and run a set of statements based on the results. It is
commonly used with two other statements called case and break.

      switch( %^CYAN%^%^BOLD%^<variable>%^RESET%^ ) {
          case %^CYAN%^%^BOLD%^<value for variable>%^RESET%^:
%^BLUE%^%^BOLD%^                < Block of statements for this case >
                break;
          case %^CYAN%^%^BOLD%^<value for variable>%^RESET%^:
%^BLUE%^%^BOLD%^                < Block of statements for this case >
                break;
          case %^CYAN%^%^BOLD%^<value for variable>%^RESET%^:
%^BLUE%^%^BOLD%^                < Block of statements for this case >
                break;
          default:
%^BLUE%^%^BOLD%^                < Block of statements for the default case >
                break; }

Now the first thing to notice is the %^CYAN%^%^BOLD%^<variable>%^RESET%^. This can be of any
variable type you wish. The %^CYAN%^%^BOLD%^<value for variable>%^RESET%^ in each of the cases
must be of the same datatype as the variable given into the switch
statement. If one of the cases test TRUE, then the block of
statements next to it is run. The break statement passes control back
out of the switch and the next line after the switch is run.

If none of the cases are true, then the default's block of statements
are run. Control would then be turned over to the line following the
switch statement.


%^RED%^%^BOLD%^-----< Special Notes >-----

1) The break statements are optional. If you leave the break out,
   the block of statements on the case will run and then control
   will "fall through" to the next case's block of statements.

2) You can have more than one case using a single block of
  statements. This is done as follows;

         case <val #1>: case <val #2>:
%^BLUE%^%^BOLD%^                < Block of statements for this case >
                break;

3) The int datatype has a special advantage in the switch statement.
   You can test a range of cases all at once using the indexing
   brackets. This is done as follows;

         case [# .. #] :
%^BLUE%^%^BOLD%^                < Block of statements for this case >
                break;

    Please see %^CYAN%^%^BOLD%^coding indexing%^RESET%^ for more info about indexing. All of
    the syntaxes for indexing apply here in the switch cases for int
    variables. This includes the reverse counting indexing method.

========================================================================

Signed,

Ironman
