Commodore PET 2001 Series Introduction Manual page 21

Hide thumbs Also See for PET 2001 Series:
Table of Contents

Advertisement

Error Message
What caused the error and how to fix it
Check to see if you have used a GOTO to branch back to a statement
preceding the DIM statement, or see if the DIM statement is inside a
FOR . . . NEXT loop or a subroutine that will be executed more than
once, or if you have used an array element before using the DIM
statement. Make DIM one of the first lines in your program.
RETURN WITHOUT GOSUB A RETURN statement was encountered
without a previous GOSUB statement being executed.
Either insert a GOSUB or delete the RETURN. Maybe you fell
through the program and should enter an END statement before
the first subroutine to prevent falling through.
STRING FORMULA TOO COMPLEX A string expression was
too complex.
Break up the string into two or more shorter expressions.
STRING TOO LONG Attempt was made by use of the concatenation
operator to create a string more than 255 characters long. Note
that a number is printed as SPACE-NUMBER-CURSOR RIGHT.
SUBSCRIPT OUT OF RANGE An attempt was made to reference a
matrix element which is outside the dimensions of the matrix.
This error can occur if the wrong number of dimensions is used in
a matrix reference; for instance, LET A(1,1,1)=Z when A has
been dimensioned DIM A(2,2).
You must either increase the space you requested for the array (
change a DIM A(10) to a DIM A(20), for example) or alter the
number of dimensions you asked for (change from DIM A(10,10)
to DIM A(10,10,10) or from DIM B(10,10,10) to DIM B(10,10)
for example).
SYNTAX ERROR Missing parenthesis in an expression, illegal char-
acter in a line, incorrect punctuation, etc.
This one is hard to find, but easy to fix. Examine the
offending statement carefully and insert or delete whatever is
necessary.
TYPE MISMATCH The left-hand side of an assignment statement
was a numeric variable and the right-hand side was a string, or
vice versa; or a function which expected a string argument was
given a numeric one or vice versa.
www.commodore.ca
Free for personal use but you must have written permission to reproduce
3 8
Error Message
What caused the error and how to fix it
Can't mix statement types, so change one side of the assignment
statement so it agrees with the other side (sides meet at the =
sign). Check the function argument types and use the correct
type (numeric or string).
UNDEFINED STATEMENT An attempt was made to GOTO,
GOSUB or THEN to a statement which does not exist.
Insert the necessary statement number or branch to another
statement number.
UNDEFINED USER FUNCTION Reference was made to a user-
defined function which had never been defined.
Define the function.
FILE OPEN You have attempted to open a previously opened tile.
Check logical file numbers (1st parameter in the OPEN state-
ment) and be sure you use unique numbers for each file or close
the file. File is now closed.
FILE NOT OPEN You have attempted to read from, write to, or
close a file not previously opened.
Open the file.
NOT INPUT FILE You tried to INPUT# from a file opened for
writing.
Reading requires a Q as the 3rd parameter of the OPEN state-
(0)
ment. Read
is the default option.
NOT OUTPUT FILE You tried to PRINT# to a file opened for
reading.
Writing to a file requires a I (or a 2 if you want an EOT at the end
of the file) as the 3rd parameter in the OPEN statement.
DEVICE NOT PRESENT You have attempted to open a file on a
device which is `invisible' to PET.
Check device numbers (2nd parameter in the OPEN statement)
and he sure the device is assigned and connected properly and
turned on.
3 9

Advertisement

Table of Contents
loading

Table of Contents