28.06.2013 Views

ISO Pascal reference manual

ISO Pascal reference manual

ISO Pascal reference manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

PROGRAM fail;<br />

VAR c:char;<br />

BEGIN<br />

c := ABS('x');<br />

END.<br />

*ERROR 108 -- SQR needs a real or integer type parameter<br />

The function SQR returns the square of either integer or real values; no<br />

other type of value may be given as the parameter.<br />

PROGRAM fail(output);<br />

BEGIN<br />

writeln(sqr(FALSE));<br />

END.<br />

*ERROR 109 -- CHR needs an integer type parameter<br />

Appendix A<br />

The parameter given to CHR may only be of type integer or a subrange of<br />

integer.<br />

PROGRAM fail;<br />

VAR c : char;<br />

x : real;<br />

BEGIN<br />

x := 1;<br />

c := CHR(x); lx isn't an integer}<br />

END.<br />

*ERROR 110 -- ODD needs an integer type parameter<br />

The function ODD may only be given a parameter of type integer or a<br />

subrange of integer.<br />

PROGRAM fail(output);<br />

VAR b : boolean;<br />

BEGIN<br />

IF ODD(b) THEN writeln('not even');<br />

END.<br />

<strong>Pascal</strong> Issue 1 83

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

Saved successfully!

Ooh no, something went wrong!