*/
If you have a PH account, you can customize your PH profile.
*/

View \TYPES.PAS

Getting Started with the Pascal tutorial, source

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


(* Chapter 6 - Program 3 *)
program Example_Of_Types;

type Array_Def  = array[12..25] of integer;
     Char_Def   = array[0..27] of char;
     Real_Array = array[-17..42] of real;
     Dog_Food   = array[1..6] of boolean;
     Airplane   = array[1..12] of Dog_Food;
     Boat       = array[1..12,1..6] of boolean;

var Index,Counter      : integer;
    Stuff              : Array_Def;
    Stuff2             : Array_Def;
    Puppies            : Airplane;
    Kitties            : Boat;

begin  (* main program *)
   for Index := 1 to 12 do
      for Counter := 1 to 6 do begin
         Puppies[Index,Counter] := TRUE;
         Kitties[Index,Counter] := Puppies[Index,Counter];
      end;
   Writeln(Puppies[2,3]:7,Kitties[12,5]:7,Puppies[1,1]:7);
end(* of main program *)

corner
© 1996-2008 CommunityHeaven LLC. 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.
North American business development: Nicolai Wadstrom. Publisher: Lars Hagelin.