| 123456789101112131415161718192021 |
- MODULE TRecord;
- // Nested records, array fields, whole-record deep copy,
- // field-designator WITH. Exit 160.
- TYPE Point = RECORD x, y : INTEGER END;
- TYPE Rect = RECORD org, ext : Point; tags : ARRAY [0..1] OF INTEGER END;
- VAR ExitCode : INTEGER;
- VAR r1, r2 : Rect;
- BEGIN
- r1.org.x := 3;
- r1.org.y := 4;
- r1.ext.x := 10;
- r1.ext.y := 20;
- r1.tags[0] := 7;
- r1.tags[1] := 8;
- r2 := r1;
- r1.tags[0] := 99;
- WITH r2.org DO
- x := x + 100
- END;
- ExitCode := r2.org.x + r2.org.y + r2.ext.x + r2.ext.y + r2.tags[0] + r2.tags[1] + r2.tags[1]
- END TRecord.
|