fpc/tests/tbs0204.pp
1999-01-27 12:47:57 +00:00

30 lines
651 B
ObjectPascal

{ boolean(byte) byte(boolean)
word(wordbool) wordbool(word)
longint(longbool) and longbool(longint)
must be accepted as var parameters
or a left of an assignment }
procedure error;
begin
Writeln('Error in tbs0204');
Halt(1);
end;
var
b : boolean;
wb : wordbool;
lb : longbool;
begin
byte(b):=1;
word(wb):=1;
longint(lb):=1;
if (not b) or (not wb) or (not lb) then
error;
byte(b):=2;
Writeln('if a boolean contains 2 it is considered as ',b);
byte(b):=3;
Writeln('if a boolean contains 3 it is considered as ',b);
shortint(b):=-1;
Writeln('if a boolean contains shortint(-1) it is considered as ',b);
end.