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.

END.<br />

[ space needed here)<br />

*ERROR 10 -- digits are required before the decimal point<br />

Appendix A<br />

This error is generated when the compiler detects a floating-point constant<br />

which has no leading digits. It is commonly caused by specifying constants<br />

such as one half as '.5' rather than '0.5'.<br />

PROGRAM fail;<br />

VAR r : real;<br />

BEGIN<br />

END.<br />

r := sin(2.34e-3);<br />

IF r > .9 THEN writeln('strange');<br />

*ERROR 11 -- a semicolon is required here<br />

The input will only make sense if the compiler assumes that a semicolon has<br />

been omitted at the indicated point.<br />

PROGRAM fail(output);<br />

VAR j : integer;<br />

BEGIN<br />

END.<br />

j := 123<br />

- there should be a semicolon here)<br />

writeln('The square root of 123 is ', SQRT(j));<br />

*ERROR 12 -- a <strong>reference</strong> to a variable is required here<br />

This message is issued when the context demands a <strong>reference</strong> to a variable<br />

and none has been found. The most common cause of this error is passing a<br />

constant when a VAR parameter was specified in the procedure heading.<br />

PROGRAM fail;<br />

PROCEDURE clear(VAR x:integer); BEGIN<br />

END;<br />

BEGIN<br />

END.<br />

x := 0;<br />

clear(1);<br />

<strong>Pascal</strong> Issue 1 49

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

Saved successfully!

Ooh no, something went wrong!