contents   index   previous   next



Case statements

 

Case statements in a switch statement may be constants, variables, or other statements that can be evaluated to a value. The following switch statement has case statements which are valid in ScriptEase.

 

switch(i)

{

   case 4:

   case foe():

   case "thorax":

   case Math.sqrt(foe()):

   case (PILLBOX * 3  2):

   default:

}

 

As described in the section on literal strings above, if either a switch expression or a case expression is a literal string, then any comparisons are based on the logic of Clib.strcmp(), that is, as if the comparisons were !Clib.strcmp(switch_expr, case_expr).

 


Initialization code which is external to functions