28.06.2013 Views

ISO Pascal reference manual

ISO Pascal reference manual

ISO Pascal reference manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

patterns (integer values); if the extended form of the compiler is being used,<br />

the bit-vector operators le and `1' may be used.<br />

PROGRAM fail;<br />

VAR x : integer;<br />

BEGIN<br />

END.<br />

b : boolean;<br />

IF x AND b THEN writeln('hello'); [x isn't boolean}<br />

*ERROR 35 -- the operand to the right of must give<br />

a boolean value<br />

The reserved words AND, OR and NOT must be followed by a boolean<br />

operand. In particular they may not be used to form conjunctions,<br />

disjunctions or inversions of bit patterns (integer values); if the extended<br />

form of the compiler is being used the bit-vector operators le, `1' and `~'<br />

may be used.<br />

PROGRAM fail;<br />

VAR x : integer;<br />

BEGIN<br />

END.<br />

b : boolean;<br />

IF b AND x THEN writeln('hello');<br />

*ERROR 36 -- this integer value is too large .<br />

This message is issued when the compiler detects that the function SQR has<br />

as its parameter an integer constant which is larger than the square root of<br />

the largest possible integer. Attempting to square this value would lead to<br />

an arithmetic fault at run-time.<br />

PROGRAM fail(output);<br />

BEGIN<br />

END.<br />

writeln(SQR(123456)); (123456 is too big for SQR}<br />

56 <strong>Pascal</strong> Issue 1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!