(* filename:  record2.pp *)

 

program recordTest (output);

{

  This program contains a definition of a record and of an array of records .

  It illustrates how to access a field of a record in an array of records.

}

 TYPE

 

   person = record

         name : string;

            age : integer;

            sex : char;

            hourlyRate : real;

      end;

 

      people = array [1..10] of person;

 

VAR  

      cs430    : people;

 

begin

  writeln (' This program is attempting to place a value in one field in an array ');

  writeln (' of records and print out the stored value. ');

  cs430[1].name := 'sam';

  writeln (' The value stored in cs430[1].name is ', cs430[1].name);

end.