| 123456789101112131415 |
- MODULE tctor6;
- // Runtime record constructor with a CHAR-array field from a string and a
- // nested record field from a variable (gnu strcons.mod shape).
- TYPE DateType = RECORD year, month, day: CARDINAL END;
- TYPE NameType = ARRAY [0..24] OF CHAR;
- PersonType = RECORD name: NameType; dob: DateType END;
- VAR d : DateType; p : PersonType;
- VAR ExitCode : INTEGER;
- BEGIN
- d.year := 1; d.month := 2; d.day := 3;
- d := DateType{1623, 6, 19};
- p := PersonType{"Blaise Pascal", d};
- IF (p.name[0] = 'B') AND (p.name[7] = 'P') AND (p.dob.year = 1623)
- THEN ExitCode := 0 ELSE ExitCode := 1 END
- END tctor6.
|