Got something to write about? Check out our Article Builder.

View \BIGREC.PAS

This is the second disk of the PASCAL TUTOR system. It has the

Submitted By: WEBMASTER
Rating: (Not rated) (Rate It)


(* 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 *)

corner
© 1996-2008. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Publisher: Lars Hagelin.
bootstrapLabs Logo A bootstrapLabs project.