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 error(output);<br />

VAR f : text;<br />

n, m : integer;<br />

BEGIN<br />

rewrite(f);<br />

writeln(f, '123, 456');<br />

reset(f)<br />

read(f, n); (will input the value 123}<br />

(leaving the comma as the next}<br />

(character to be input}<br />

read(f, m); (the comma makes this fail}<br />

writeln('Error not detected');<br />

END.<br />

*Execution error -- is not an acceptable field width<br />

Appendix C<br />

This error is caused by attempting to specify an output field width with a<br />

value which is less than one.<br />

PROGRAM error(output);<br />

VAR f : text;<br />

j : integer;<br />

BEGIN<br />

rewrite(f);<br />

FOR j := 3 DOWNTO -3 DO<br />

writeln(f, 12345:j); (fails when j=0}<br />

writeln('Error not detected');<br />

END.<br />

*Execution error -- cannot extend heap<br />

The heap is the area of memory in which the compiler manages the storage<br />

claimed and released by calls on NEW and DISPOSE. This error is issued<br />

when the area is full and no more memory can be found. The common<br />

cause of this error is calling NEW repeatedly without releasing unwanted<br />

space by DISPOSE.<br />

PROGRAM error(output);<br />

TYPE bigrec = RECORD a : ARRAY C1..1007 OF integer END;<br />

VAR pr : bigrec;<br />

<strong>Pascal</strong> Issue 1

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

Saved successfully!

Ooh no, something went wrong!