Modula-3 Records
Modula-3 records are a Cartesian Product type.
- Definition:
- e.g., Modula-3 records.
TYPE Polygon = RECORD NoOfSides : INTEGER; SizeOfSides : REAL END VAR poly1, bigsquare : Polygon
defines an INTEGER
× REAL
cartesian product.
- Access:
- dot notation.
circumference := poly1.NoOfSides * poly1.SizeOfSides;
- Sequential construction:
- dot notation in assignment.
bigsquare.NoOfSides := 4; bigsquare.SizeOfSides := 195.6;
- Simultaneous construction:
- (Modula-3)
bigsquare := Polygon{NoOfSides := 4; SizeOfSides := 195.6};
Updated Thu Sept. 24 2015, 08:08 by cameron.