variants explicit casts



variants_explicit_casts
Smart pascal source code
var v: Variant; var s: String; var i: Integer; var f: Float; v := '123'; s := String(v) + String(v); WriteLn(s); i := Integer(v) + 4; WriteLn(i); v := 123; s := String(v) + String(v); WriteLn(s); i := Integer(v) + 4; WriteLn(i); v := 123.4; s := String(v) + String(v); WriteLn(s); i := Integer(v) + 1; WriteLn(i); f := Float(v) + 1; WriteLn(f); {<<< RESULT - CONSOLE LOG >>> ----------------------------- 123123 127 123123 127 123.4123.4 124 124.4 ----------------------------- {<<<<<<<<< THE END >>>>>>>>>}