background image

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.

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-
ment. Read 

(0)

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

1

www.commodore.ca

Free for personal use but you must have written permission to reproduce

Summary of Contents for PET 2001 Series

Page 1: ...www commodore ca Free for personal use but you must have written permission to reproduce...

Page 2: ...cket 8 Exercise 4 Creating a program 8 Exercise 5 Listing and running your program 10 Exercise 6 A mending the program 10 Exercise 7 Screen editing 12 Exercise 8 Using the reverse field 15 Exercise 9...

Page 3: ...gh with this booklet you should be on your way to enjoying and using your PET to its fullest Unpacking your PET and turning it on Please check the carton for any special unpacking instructions And exa...

Page 4: ...removed This protection was left in place to protect the keys against scratches during shipping To remove the film carefully peel off with your fingernail Key top legends bear much resemblance to tho...

Page 5: ...e You could delete characters back to that point then retype But there is an easier way PET has a feature called screen edit which allows you to move the cursor to any position on the line and at that...

Page 6: ...where you want it on the screen Exercise 3 Using graphics If you have accomplished moving the cursor then you can use your PET like an electronic sketch pad The characters on the upper half of each ke...

Page 7: ...e correct number the question mark and the quotes Then press I at an t time in this exercise If this happens first clear the screen again and start over When your rocket is complete move the cursor to...

Page 8: ...h a stream of rockets are blasting off from the bottom of the screen and are streaking off the top To do this we will learn a new BASIC language command Type this line in The line number 100 was chose...

Page 9: ...e power on switch not only stops the program it also destroys the program statements You ve put in a lot of time typing theta and stay not want them destroyed do not press the SHIFT key This will effe...

Page 10: ...see onto the screen We say almost because the screen displays characters in white Your PET displays 128 unique symbols which with the addition of reverse field really adds up to a total of 256 differe...

Page 11: ...or right to the next desired character position to be typed Tilt C If a quotation mark has been used press program line Then move the cursor up to leave the and over to one space These print out which...

Page 12: ...e offending character and retype Furthermore to program cursor controls within the string after having left the line the user must use the appropriate control character The user can of course close th...

Page 13: ...ts arc elapsed minutes and the last two digits are elapsed seconds which in the above example means that PET has been running for 00 hours 1 1 minutes and 30 seconds The time you see on your PET howev...

Page 14: ...he parentheses first before it does any thing outside of them Once inside parentheses PET does multiplication and division then addition and subtraction After all the work inside the parentheses is do...

Page 15: ...A NUMBER 110 INPUT X 115 PRINT ANOTHER NUMBER 120 INPUT Y Since lines 130 and 140 stay the same we won t retype them Here line 100 prints a message When you run the program PET will print the message...

Page 16: ...perations FOR as many times as you like The word NEXT is the last line of the sequence and tells PET that it has completed all the repeatable operations Type these lines 90 FOR I 1 TO 10 150 NEXT I In...

Page 17: ...r use Place a blank cassette in the recorder unit and press REW to be sure the tape is fully rewound When rewinding is complete press STOP on the cassette unit You are ready now to save your program I...

Page 18: ...But since you may not want to type the full program name each time PET is designed not to REQUIRE a name even a third SAVE may prevent loss of your program and will prove to he worth the extra few mi...

Page 19: ...en loading is complete the program will automatically begin executing Also the cassette motor will be turned off We re assuming that your PET s program is labeled PROGRAM for the sake of this example...

Page 20: ...formed 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...

Page 21: ...ffending 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...

Page 22: ...ements Continued COMMAND STATEMENT EXAMPLE PURPOSE TI TI HHMMSS Sets PET s internal clock to real time TI PRINT TI Displays number of jiffies since PET was USR USR X powered up or clock was zeroed A j...

Page 23: ...built in cassette by reading it and com paring it with program still in PET s memory Verifies specified program NAME saved on built in cassette by reading it and comparing it with program still in PET...

Page 24: ...Returns 1 if argument is negative returns 0 if argument is zero and returns 1 if argument is positive SIN 10 C SIN A Returns sine of argument A must be expressed in radians SQR 10 C SQR A Returns squ...

Page 25: ...the cabinet with a soaped well wrung sponge Do not use any commercial abrasive cleaners Rinse by wiping with clean slightly damp sponge or soft cloth Do not immerse in water Clean the recorder unit in...

Page 26: ...mately one inch per second during this time 6 Slowly move demagnetizer to erase head and then to all other ferrous metal surfaces which cone into proximity with the tape 7 Now slowly move demagnetizer...

Page 27: ...94304 This is the only address if you want Commodore to evaluate and distribute your program It s been brought to our attention that some free lance operators are soliciting PET users for programs an...

Page 28: ...liffe Stockton on Tees Teeside TS 160 PN England Commodore Business Machines Limited 360 Euston Road London NW1 3BL England Commodore Buromaschinen GmbH Frankfurter Strasse 171 175 6078 Neu Isenburg W...

Reviews: