record passing I



record passing I
Smart pascal source code
type TPoint = record x, y: Integer; end; procedure WriteLnPoint(const xy: TPoint); begin WriteLn(xy.x); WriteLn(', '); WriteLn(xy.y); end; procedure PassCopy(ab: TPoint); begin ab.x := 1; WriteLnPoint(ab); end; procedure PassVar(var ab: TPoint); begin ab.y := 2; WriteLnPoint(ab); end; var xy: TPoint; WriteLnPoint(xy); PassCopy(xy); PassVar(xy); WriteLnPoint(xy); {<<< RESULT - CONSOLE LOG >>> ----------------------------- 0, 0 1, 0 0, 2 0, 2 ----------------------------- {<<<<<<<<< THE END >>>>>>>>>}