                                (* Chapter 9 - Program 2 *)
program A_Larger_Record;

const  Number_Of_Friends = 50;

type Full_Name = record
      First_Name : string[12];
      Initial    : char;
      Last_Name  : string[15];
      end;

     Date      = record
      Day        : byte;
      Month      : byte;
      Year       : integer;
      end;

     Person    = record
      Name       : Full_Name;
      City       : string[15];
      State      : string[2];
      Zipcode    : string[5];
      Birthday   : Date;
      end;

var   Friend             : array[1..Number_Of_Friends] of Person;
      Self,Mother,Father : Person;
      Index              : byte;

begin  (* main program *)
   Self.Name.First_Name := 'Charley';
   Self.Name.Initial    := 'Z';
   Self.Name.Last_Name  := 'Brown';
   with Self do begin
      City := 'Anywhere';
      State := 'CA';
      Zipcode := '97342';
      Birthday.Day := 17;
      with Birthday do begin
         Month := 7;
         Year := 1938;
      end;
   end;    (* all data for self now defined *)

   Mother := Self;
   Father := Mother;
   for Index := 1 to Number_Of_Friends do
      Friend[Index] := Mother;
   Write(Friend[27].Name.First_Name,' ');
   Write(Friend[33].Name.Initial,' ');
   Write(Father.Name.Last_Name);
   Writeln;
end. (* of main program *)




{ Result of execution

Charley Z Brown

}
