Commodore — Commodore Business Machines PET 2001 (EN)

Error Message What caused the error and how to fix it Error Message What caused the error and how to fix it = for end 38 39 1 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. TRING FORMULA TOO COMPLEX A string expression was too complex. Break up the string into two or more shorter expressions. TRING 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. UBSCRIPT 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). YNTAX 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.

YPE 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 Can't mix statement types, so change one side of the as statement so it agrees with the other side (sides meet at sign). Check the function argument types and use the type (numeric or string). UNDEFINED STATEMENT An attempt was made to G GOSUB or THEN to a statement which does not ex Insert the necessary statement number or branch to anot statement number.

UNDEFINED USER FUNCTION Reference was made to a u defined function which had never been defined. Define the function. FILE OPEN You have attempted to open a previously opene Check logical file numbers (1st parameter in the OPEN s ment) and be sure you use unique numbers for each fil the file. File is now closed. FILE NOT OPEN You have attempted to read from, write close a file not previously opened. Open the file. NOT INPUT FILE You tried to INPUT# from a file opene writing. Reading requires a Q as the 3rd parameter of the OPEN ment. Read (0) is the default option. NOT OUTPUT FILE You tried to PRINT# to a file opene reading.

Writing to a file requires a I (or a 2 if you want an EOT at of the file) as the 3rd parameter in the OPEN statemen DEVICE NOT PRESENT You have attempted to open a fi device which is `invisible' to PET. Check device numbers (2nd parameter in the OPEN st and he sure the device is assigned and connected prope turned on.