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.

Appendix C<br />

Execution errors<br />

*Execution error -- user termination<br />

This systems permits the user to force an executing program to stop with<br />

this message in order to provide diagnostic information, for example when a<br />

program goes into an infinite loop.<br />

*Execution error -- real value too large<br />

This message indicates that an real (floating-point) operation has resulted in<br />

a value which is too large to be handled by the normal real hardware.<br />

PROGRAM error(output);<br />

VAR n : real;<br />

BEGIN<br />

END.<br />

times : integer;<br />

n := 1.0;<br />

FOR times := 1 TO 100 DO<br />

n := SQR(n); (bound to get too big}<br />

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

*Execution error -- attempted division by zero<br />

The program has attempted to divide one quantity by zero.<br />

PROGRAM error(output);<br />

VAR j, k : integer;<br />

BEGIN<br />

END.<br />

j := 123;<br />

k := 0;<br />

writeln('123/0 = j/k); (wrong}<br />

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

<strong>Pascal</strong> Issue 1 103

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

Saved successfully!

Ooh no, something went wrong!