record clone 1



record_clone1
Smart pascal source code
type TSubRec = record A, B: Integer; end; type TRec = record S: TSubRec; C: Integer; procedure WriteLnIt; begin WriteLn(S.A); WriteLn(S.B); WriteLn(C); end; end; var r1, r2: TRec; r1.S.A := 1; r1.S.B := 2; r1.C := 3; r2.WriteLnIt; r2 := r1; r2.WriteLnIt; procedure Test(r: TRec); begin r.WriteLnIt; end; r1.S.A := 10; r1.C := 30; Test(r1); Test(r2); {<<< RESULT - CONSOLE LOG >>> ----------------------------- Errors >>>> Hint: "s" does not match case of declaration ("S") [line: 19, column: 4] Hint: "s" does not match case of declaration ("S") [line: 20, column: 4] Hint: "b" does not match case of declaration ("B") [line: 20, column: 6] Hint: "c" does not match case of declaration ("C") [line: 21, column: 4] Result >>>> 000 123 10230 123 ----------------------------- {<<<<<<<<< THE END >>>>>>>>>}