date and time created 80/10/30 00:35:38 by mckusick
[unix-history] / .ref-BSD-3 / usr / doc / pascal / exprout
CommitLineData
1f017636
BJ
1Berkeley Pascal PI -- Version 1.1 (January 4, 1979)
2
3Sat Mar 31 11:50 1979 expr.p
4
5 1 program x(output);
6 2 var
7 3 a: set of char;
8 4 b: Boolean;
9 5 c: (red, green, blue);
10 6 p: ^ integer;
11 7 A: alfa;
12 8 B: packed array [1..5] of char;
13 9 begin
14 10 b := true;
15 11 c := red;
16 12 new(p);
17 13 a := [];
18 14 A := 'Hello, yellow';
19 15 b := a and b;
20 16 a := a * 3;
21 17 if input < 2 then writeln('boo');
22 18 if p <= 2 then writeln('sure nuff');
23 19 if A = B then writeln('same');
24 20 if c = true then writeln('hue''s and color''s')
25 21 end.
26E 14 - Constant string too long
27E 15 - Left operand of and must be Boolean, not set
28E 16 - Cannot mix sets with integers and reals as operands of *
29E 17 - files may not participate in comparisons
30E 18 - pointers and integers cannot be compared - operator was <=
31E 19 - Strings not same length in = comparison
32E 20 - scalars and Booleans cannot be compared - operator was =
33e 20 - Input is used but not defined in the program statement
34In program x:
35 w - constant green is never used
36 w - constant blue is never used
37 w - variable B is used but never set