t_record_multidim_const.mod 429 B

12345678910111213141516
  1. MODULE TRecordMultiDimConst;
  2. (* M5: static record constructor with a rank-2 array field. *)
  3. TYPE
  4. Row = ARRAY [0..2] OF INTEGER;
  5. Grid = ARRAY [0..1] OF Row;
  6. Rec = RECORD tag : INTEGER; g : Grid END;
  7. CONST c = Rec { 7, Grid { Row{1,2,3}, Row{4,5,42} } };
  8. VAR ExitCode : INTEGER;
  9. BEGIN
  10. IF (c.tag = 7) AND (c.g[1,2] = 42) AND (SIZE(c.g) = 24) THEN
  11. ExitCode := 42
  12. ELSE
  13. ExitCode := 1
  14. END
  15. END TRecordMultiDimConst.