case-statement with non-ordinal datatypes |
Pas2JS pascal source code
var s: string = 'hello'; b: Boolean; BEGIN case s of 'hello': WriteLn('Hello!'); 'goodbye': WriteLn('Goodbye!'); end; case b of true: WriteLn('Default value of boolean is TRUE'); false: WriteLn('Default value of boolean is FALSE'); end; { ### CONSOLE OUTPUTS ### Hello! Default value of boolean is FALSE }