case..of statement | Variant condition



case..of statement | Variant
Smart pascal source code
var s : Variant = 'mummy'; i : Variant = 10; vs := 'dummy'; vi : Integer; BEGIN case vs of s : WriteLn('bug'); Variant('dummy') : WriteLn('ok'); else WriteLn('bug'); end; vi := 12; case vi of i : WriteLn('bug'); (i+1)..12 : WriteLn('ok'); else WriteLn('bug'); end; { ### CONSOLE OUTPUTS ### ok ok } { <<< TEST II >>> } s := 'dummy'; i := 12; case s of 'mummy' : WriteLn('bug'); 'dummy' : WriteLn('ok'); else WriteLn('bug'); end; case i of 10 : WriteLn('bug'); 11..12 : WriteLn('ok'); else WriteLn('bug'); end; { ### CONSOLE OUTPUTS ### ok ok }