var param rec field |
Smart pascal source code
type TRec = record a: Integer; end; procedure Test(var a: Integer); begin Inc(a); end; var r: TRec; r.a := 123; var i := r.a; Test(i); WriteLn(i); test(r.a); //---> Syntax Error: Only a variable can be be passed as Var-parameter {<<< RESULT - CONSOLE LOG >>> ----------------------------- 124 ----------------------------- {<<<<<<<<< THE END >>>>>>>>>}