variants casts



variants_casts
Smart pascal source code
var v: Variant; var s: String; var f: Float; var i: Integer; var b: Boolean; s := 'abcd'; v := s; WriteLn(v); v := 'efgh'; s := v; WriteLn(s); WriteLn(v); f := 1.234; v := f; WriteLn(v); v := 5.678; f := v; WriteLn(FloatToStr(f)); WriteLn(FloatToStr(v)); i := 1234; v := i; WriteLn(v); v := 5678; i := v; WriteLn(IntToStr(i)); WriteLn(IntToStr(v)); b := True; v := b; WriteLn(v); v := False; b := v; WriteLn(b); WriteLn(v); {<<< RESULT - CONSOLE LOG >>> ----------------------------- abcd efgh efgh 1.234 5.678 5.678 1234 5678 5678 True False False ----------------------------- {<<<<<<<<< THE END >>>>>>>>>}