record result III



record_result III
Smart pascal source code
type TRec = record x, y: Integer; procedure WriteLnIt; begin WriteLn(x); WriteLn(','); WriteLn(y); end; end; var r: TRec; procedure IncX(var r: TRec); begin r.x += 1; end; function Func(y: Integer): TRec; begin Result.x := y; Result.y := y * 2; IncX(Result); end; function Nested(i: Integer): TRec; begin if i = 0 then Exit(r); Result := Func(i); IncX(Result); end; IncX(r); r.WriteLnIt; r := Func(3); r.WriteLnIt; r := Nested(0); r.WriteLnIt; r := Nested(1); r.WriteLnIt; var r1 := Nested(0); IncX(r); r1.WriteLnIt; r.WriteLnIt; {<<< RESULT - CONSOLE LOG >>> ----------------------------- Errors >>>> Hint: "X" does not match case of declaration ("x") [line: 14, column: 6] Result >>>> 1,0 4,6 4,6 3,2 3,2 4,2 ----------------------------- {<<<<<<<<< THE END >>>>>>>>>}