home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / PASCSRC.ZIP / BIGREC.PAS < prev    next >
Pascal/Delphi Source File  |  1988-01-15  |  1KB  |  53 lines

  1.                                 (* Chapter 9 - Program 2 *)
  2. program A_Larger_Record;
  3.  
  4. const  Number_Of_Friends = 50;
  5.  
  6. type Full_Name = record
  7.       First_Name : string[12];
  8.       Initial    : char;
  9.       Last_Name  : string[15];
  10.       end;
  11.  
  12.      Date      = record
  13.       Day        : byte;
  14.       Month      : byte;
  15.       Year       : integer;
  16.       end;
  17.  
  18.      Person    = record
  19.       Name       : Full_Name;
  20.       City       : string[15];
  21.       State      : string[2];
  22.       Zipcode    : string[5];
  23.       Birthday   : Date;
  24.       end;
  25.  
  26. var   Friend             : array[1..Number_Of_Friends] of Person;
  27.       Self,Mother,Father : Person;
  28.       Index              : byte;
  29.  
  30. begin  (* main program *)
  31.    Self.Name.First_Name := 'Charley';
  32.    Self.Name.Initial    := 'Z';
  33.    Self.Name.Last_Name  := 'Brown';
  34.    with Self do begin
  35.       City := 'Anywhere';
  36.       State := 'CA';
  37.       Zipcode := '97342';
  38.       Birthday.Day := 17;
  39.       with Birthday do begin
  40.          Month := 7;
  41.          Year := 1938;
  42.       end;
  43.    end;    (* all data for self now defined *)
  44.  
  45.    Mother := Self;
  46.    Father := Mother;
  47.    for Index := 1 to Number_Of_Friends do
  48.       Friend[Index] := Mother;
  49.    Write(Friend[27].Name.First_Name,' ');
  50.    Write(Friend[33].Name.Initial,' ');
  51.    Write(Father.Name.Last_Name);
  52.    Writeln;
  53. end. (* of main program *)