home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Education Master 1994 (4th Edition)
/
EDUCATIONS_MASTER_4TH_EDITION.bin
/
files
/
progscal
/
ptutor2b
/
constant.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1988-01-15
|
940b
|
28 lines
(* Chapter 6 - Program 4 *)
program Example_Of_Constants;
const Max_Size = 12; (* Pascal assumes this is a byte type, but it
can be used as an integer also *)
Index_Start : integer = 49; (* This is a typed constant *)
Check_It_Out : boolean = TRUE; (* Another typed constant *)
type Bigarray = array[1..Max_Size] of integer;
Chararray = array[1..Max_Size] of char;
var Airplane : Bigarray;
Seaplane : Bigarray;
Helicopter : Bigarray;
Cows : Chararray;
Horses : Chararray;
Index : integer;
begin (* main program *)
for Index := 1 to Max_Size do begin
Airplane[Index] := Index*2;
Seaplane[Index] := Index*3 + 7;
Helicopter[Max_Size - Index + 1] := Index + Airplane[Index];
Horses[Index] := 'X';
Cows[Index] := 'R';
end;
end. (* of main program *)