
36
Appendix
1. Error messages
When an error occurs. PET returns to Command level and displays
READY on its TV screen. Variable values and the program text
remain
intact, but the program cannot he continued using the CONT
command.
GOSUB and all FOR
... NEXT context is lost, insofar
as the current run
is concerned.
When an error occurs in a program statement, the error message dis-
play will indicate the line number in which the error occurred.
When the error occurs in a direct, or command level, statement, no
Tine number is displayed with the error message.
Error Message
What caused the error and how to fix it
CAN'T CONTINUE
Attempt to continue a program when none
exists. an error occurred, after a new line was typed into the
program, or a correction was made to an existing line.
Correct the error, then use a directed GOTO to get back into
the program, or type RUN and start over.
DIVISION BY ZERO
Dividing by zero is an error. Check the
expression
used for the denominator in the offending arithmetic
statement.
then correct it so it can never he evaluated as
0
.
ILLEGAL DIRECT
Use of an INPUT, GET, or DEF statement as
a
direct command.
Avoid using these statements as direct commands.
ILLEGAL QUANTITY
The parameter passed to a math or string
function was out of range. "ILLEGAL QUANTITY" errors can
occur due to:
a. a negative matrix subscript, such as LET A (-I
)
= 0*
b.
an unreasonably large matrix subscript: X=A(65536)*
c.
LOG-negative or zero argument, as LOG(-X)**
d. SQR-
negative argument, as SQR(-4)
e. At B if A is a negative
value and B is not an integer.
(It works if a constant is used instead of a variable,
i.e.,
-4t B, because exponentiation is performed before unary
minus.)
f. A call to USR before the address of the machine language
subroutine has been patched in.
Error
Message
What
caused
the
error
and
how
to
fix
it
*Subscripts must be equal to or greater than
0,
and less than or equal to 65535.
**
Be sure the argument is within the range of the function being used.
NEXT WITHOUT FOR
The variable in a NEXT statement corres-
ponds to no previously executed FOR statement.
The FOR part of a FOR
... NEXT loop must be inserted or the
offending NEXT part of the loop must he deleted. Be sure the
index
variables are the sunk at both ends of the loop.
Example: FOR I = I TO 10
NEXT I
OUT OF DATA A READ
statement was executed but all of the
DATA statements in the program have already been read. The
program tried to read too much data or insufficient data was
included in the program.
Use the RESTORE: statement to restore the data so PET can
read it again, or restrict the number of READs to the correct
number of DATA elements, or add more DATA elements, or
use a flag at end of data list check for it before reading.
OVERFLOW The result of a calculation was too large to he repre
sented
in BASIC's number format. (If an underflow occurs, zero
is given as
the result and execution continues without any error
message being
printed.)
You requested a number greater than even PET can remember.
Try
asking for a smaller number. The largest possible number is
1.
70141 183E+38. Change the order of your calculations.
REDIMENSIONED ARRAY
After a matrix was dimensioned,
another
dimension statement for the same matrix was
encountered. This
error often occurs if a matrix has been given
the default
dimension 10 because a statement like A( I)=3 is encountered and
then later in the program, a l)IM A( 100)
is
found.
37
www.commodore.ca
Free for personal use but you must have written permission to reproduce