Download ZBasic Manual
Transcript
ERRORS ERRORS There are different types of error messages. When errors are encountered during compilation, compiling is stopped and the offending line is displayed. This is a Compile Time error. Errors encountered during execution of a program are called Runtime Errors. COMPILE TIME ERRORS After typing RUN, ZBASIC compiles the program. If errors are encountered, ZBASIC will stop compiling and display the error on the screen along with the offending line (when compiling form disk using RUN "Filename" or RUN*, ZBasic will stop compiling, load the Source Code, and LIST the line where the error occurred.) The Statement within the line and the line number will be displayed. The following program would cause ZBASIC to print an error during compile: 00010 00020 00030 00040 CLS PRINT "HELLO THERE MR. COMPUTER USER!" PRINT "I AM A COMPUTER" Z=Z+1: X=X+Z: PWINTX RUN Syntax Error in Stmt 03 at Line 00040 00040 Z=Z+1: X=X=Z: PWINT X NOTE: The error will be marked in some way depending on the computer system being used. The error marker indicates the general error location on the line where compilation stopped. To edit line 40 above type: EDIT 40 (or just comma). Fix the spelling of PRINT. ZBasic will often display the missing character it expected. 00010 INPUT"Enter a number" A$ RUN ";" expected error in Stmt 01 at line 00010 00010 INPUT"Enter a number"_A$ 00010 DIM A(10,10) 00020 A(X)=100 RUN "," expected error in Stmt 01 at line 00020 00020 A(X_) Error Messages 28