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.

Errors and debugging<br />

correct use of features which the error indicates have been misused. In the<br />

error message statements, any item enclosed in angle brackets e.g.<br />

< something > will be replaced by an item appropriate to the context of the<br />

message.<br />

5.1.3 Fatal compile errors<br />

Certain errors cause the compiler to abort the compilation without trying to<br />

analyse the rest of the <strong>Pascal</strong> program.<br />

Fatal errors are marked by the text<br />

*FATAL ERROR nnn --<br />

followed by the reason for stopping. The only way to prevent the same fatal<br />

error occuring again is to change the program in the way recommended.<br />

For example, if the fatal error was caused by the end of program token<br />

`end.' being encountered too soon, look through the source for a `.' where<br />

there should be a ;'.<br />

The range of FATAL errors produced by the compiler is listed in Appendix<br />

B.<br />

5.2 Run-time errors<br />

When an error is detected at run-time, an event is signalled to the diagnostic<br />

package which generates a post-mortem backtrace of the error.<br />

Following the report of the nature of the error, information is displayed<br />

about the environment of the statement causing the error. This information<br />

includes the line number at which the error was detected, the name of the<br />

block containing that line, and the values of any local variables declared in<br />

that block.<br />

If no value has yet been given to a variable, its value is printed as 'not<br />

assigned'. Large integer values will be printed in both decimal and<br />

hexadecimal (base 16) representations. If an integer value corresponds to<br />

the ASCII code for a printable character, then that character will be<br />

displayed as well. This process is repeated for the statement (usually a<br />

procedure call) which invoked this block, and so on back to the start of the<br />

program. Finally, the error and information about where it occurred is<br />

repeated in case the original copy has been scrolled off the top of the screen.<br />

<strong>Pascal</strong> Issue 1 29

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

Saved successfully!

Ooh no, something went wrong!