![](/images/backgrounds/286549/hp-sunsoft-pascal-4-0-users-manual-549395237x1.png)
9
program expr_example(output);
var
a: set of char;
b: Boolean;
c: (red, green, blue);
p: ^ integer;
A: alfa;
B: packed array [1..5] of char;
begin
b := true; c := red; new(p);
a := [];
A := 'Hello, yellow'; b := a and b;
a := a * 3;
if input < 2 then writeln('boo');
if p <= 2 then writeln('sure nuff'); if A = B then writeln('same');
if c = true then writeln('hue''s and color''s') end. { expr_example }
This program generates the following error messages:
hostname% pc expr.p
Mon Feb 13 13:36:51 1995 expr.p:
E 13050 line 16 - Constant string too long
E 20070 line 17 - | Left operand of and must be Boolean, not set | |||
E 25550 line 18 - | expression has invalid type |
| ||
E 20030 line 18 - | Cannot mix sets with integers and reals as operands of * | |||
E 20240 | line 19 | - | files may not participate in | comparisons |
E 20230 | line 20 | - | pointers and integers cannot | be compared - operator was <= |
E 20220 | line 21 | - | Strings not same length in = | comparison |
E 20230 | line 22 | - | scalars and Booleans cannot be compared - operator was = |
Error Diagnostics | 213 |