xref: /csrg-svn/usr.bin/pascal/pdx/test/test.p (revision 62160)
148088Sbostic(*
2*62160Sbostic * Copyright (c) 1980, 1993
3*62160Sbostic *	The Regents of the University of California.  All rights reserved.
448088Sbostic *
548088Sbostic * %sccs.include.redist.c%
648088Sbostic *
7*62160Sbostic *	@(#)test.p	8.1 (Berkeley) 06/06/93
848088Sbostic *)
948088Sbostic
1048088Sbosticprogram blah(input, output);
1148088Sbosticconst
1248088Sbostic	CONSTANT = 3;
1348088Sbostic	FLTCON = 3.14;
1448088Sbostictype
1548088Sbostic	Index = 1..10;
1648088Sbostic	intarray = array[Index] of 0..100;
1748088Sbostic	rec = record
1848088Sbostic		x : integer;
1948088Sbostic		y : char;
2048088Sbostic		z : integer;
2148088Sbostic	end;
2248088Sbosticvar
2348088Sbostic	i : integer;
2448088Sbostic	x : real;
2548088Sbostic	a : array[1..10] of intarray;
2648088Sbostic	r : rec;
2748088Sbostic	p : ^rec;
2848088Sbostic	b : boolean;
2948088Sbostic	unused : integer;
3048088Sbostic
3148088Sbosticfunction first(var p : integer) : integer;
3248088Sbosticbegin
3348088Sbostic	i := p;
3448088Sbostic	r.x := 4;
3548088Sbostic	r.y := 'y';
3648088Sbostic	r.z := 6;
3748088Sbostic	b := true;
3848088Sbostic	first := p;
3948088Sbosticend;
4048088Sbostic
4148088Sbosticprocedure start;
4248088Sbosticvar	q : integer;
4348088Sbosticbegin
4448088Sbostic	q := -5;
4548088Sbostic	q := first(q);
4648088Sbostic	a[i][1] := q;
4748088Sbosticend;
4848088Sbostic
4948088Sbosticprocedure init;
5048088Sbosticvar	i, j : integer;
5148088Sbosticbegin
5248088Sbostic	b := false;
5348088Sbostic	for i := 1 to 10 do begin
5448088Sbostic		for j := 1 to 10 do begin
5548088Sbostic			a[i][j] := 10*(i-1) + j;
5648088Sbostic		end;
5748088Sbostic	end;
5848088Sbostic	start;
5948088Sbosticend;
6048088Sbostic
6148088Sbosticbegin
6248088Sbostic	init;
6348088Sbostic	a[1][1] := 3;
6448088Sbostic	a[10][1] := 2;
6548088Sbostic	a[1][10] := 1;
6648088Sbostic	writeln('garbage');
6748088Sbostic	readln(i);
6848088Sbosticend.
69