int e l CHAPTER 8 Error Messages, Bells, Whistles, and Anomalies 8.1 ERROR MESSAGES MCS BASIC-52 has a relatively sophisticated ERROR processor. When BASIC is in the RUN mode the generalized form of the ERROR message is as follows: ERROR: XXX - IN LINE YYY YYY BASIC STATEMENT -----------x Where XXX is the ERROR TYPE and YYY is the line number of the program in which the error occurred. A specific example is: ERROR BAD SYNTAX - IN LINE 10 10 PRINT 34*21* --------------x The X signifies approximately where the ERROR occurred in the line number.
The specific location of the X may be off by one or two characters or expressions depending on the type of error and where the error occurred in the program. If an ERROR occurs in the COMMAND MODE only the ERROR TYPE will be printed out NOT the Line number. This makes sense, because there are no line numbers in the COMMAND MODE. The ERROR TYPES are as follows: BAD SYNTAX A BAD SYNTAX error means that either an invalid MCS BASIC-52 COMMAND, STATEMENT, or OPERATOR was entered and BASIC cannot process the entry. The user should check and make sure that everything was typed in correctly.
In Version 1.1 of MCS BASIC-52 a BAD SYNTAX ERROR is also generated if the programmer attempts to use a reserved keyword as part of a variable. BAD ARGUMENT When the argument of an operator is not within the limits of the operator a BAD ARGUMENT ERROR will be generated. For instance. DBY(257) would generate a BAD ARGUMENT ERROR because the argument for the DBY operator is limited to the range 0 to 255. Similarly, XBY(5000H) = -1 would generate a BAD ARGUMENT ERROR because the value of the XBY operator is limited to the range 0 to 255. - 96 -