13.07.2015 Views

Turbo Basic

Turbo Basic

Turbo Basic

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

A p p E N D x EError MessagesThere are two fundamental types of errors in <strong>Turbo</strong> <strong>Basic</strong>: compile-time and runtime.Compile-time errors are errors in syntax discovered by the compiler. Runtimeerrors are anomalies caught by error-detection mechanisms the compilerplaces in your object programs.Most compile-time errors are errors of syntax, caused by missing symbols, misspelledcommands, unbalanced parentheses, and so on. If the compiler finds somethingin a source program that it cannot understand or permit, you areautomatically placed in the editor, with the cursor positioned at the point of theerror. Press any key to clear the error message, then edit the offending statementand recompile.At the bottom of the screen, <strong>Turbo</strong> <strong>Basic</strong> lists the error number and a briefdescription of the error. Compiler errors have error codes of 256 and above.Run-time errors occur when a compiled program is executed. Examples include£He-system errors (disk full or write-protected), improper function calls (graphicsstatements without a graphics adapter), trying to take the square root of -14,memory errors (usually, not enough), and a host of other problems.Run-time errors can be trapped; that is, you can cause a designated error-handlingsubroutine to get control should an error occur using the ON ERROR statement.This routine can "judge" what to do next based on the type of error thatoccurs. File-system errors in particular (for example, disk full) are well-suited tohandling such routines; they are the only errors that a thoroughly debugged programshould have to deal with.411

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

Saved successfully!

Ooh no, something went wrong!