Applying these rules, we can state the following definition and declaration: 

type Complex = record Re,Im: Real end; var Z: Complex; 

where Complex is a type identifier, Re and 1m are identifiers of fields, and Z is a variable of type Complex. Consequently, Z is a record made up of two components or fields. See Program 7.1. 

To access a record component, the name of the record is followed by a period, and the respective field identifier (see Figure 6.c). For example, the following assigns 5 + 3i to z: 

Likewise, a type representing a date can be defined as: 

Z.Re .- 5: Z.Im := 3 

Date = packed record Year: 1900 .. 2100; Mo: (Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec); Day: 1 .. 31 end 

Note: The type Date also includes, for instance, a 31st April. A toy can be described as: 

Toy = record end Kind: (Ball, Top, Boat, Doll, Blocks, Game, Model, Book); Cost: Real; Received: Date; Enjoyed: (Alot, Some, Alittle, None); Broken, Lost: Boolean 

A homework assignment can be defined as: 

Assignment = packed record Subject: (History, Language, Lit, Math, Psych, Science); Assigned: Date; Grade: O •• 4; Weight: 1 .. 10 end 

