var param casts



var_param_casts
Smart pascal source code
var v: Variant := 0; procedure TestFloat(var f: Float); begin f := v; end; var f: Float; TestFloat(f); WriteLn(f - f); procedure TestInteger(var i: Integer); begin f := v; end; var i: Integer; v := 1.0; TestInteger(i); WriteLn(i - i); procedure TestString(var s: String); begin s := v; end; var s: String; v := 'hello'; TestString(s); WriteLn(v + v); procedure TestBool(var b: Boolean); begin b := v; end; var b: Boolean; v := True; TestBool(b); WriteLn(b and b); {<<< RESULT - CONSOLE LOG >>> ----------------------------- 0 0 hellohello True ----------------------------- {<<<<<<<<< THE END >>>>>>>>>}