UM0715
6 Errors
Errors
Sometimes PrimerBasic will terminate with an error message. Usually these are due to typing mistakes or logic errors in the basic program. Occasionally they may be caused by the computer running out of resources, by illegal input, or by internal errors in the
PrimerBasic interpreter.
Following a list of the errors that can be occurred.
●
Can’t read program
You have called PrimerBasic with something it cannot recognise as a PrimerBasic program at all, for instance with a text file containing a nursery rhyme.
●
Program lines not in order
Lines have to be in numerical order. If lines are out of order, you will receive this error.
●
Line not found
You have tried to jump to a non existent line.
●
Syntax error line
This means that the interpreter has encountered a line it cannot understand. It is a catch all error, incorporating things such as identifiers starting with digits, or lines not terminated with a newline.
●
Out of memory
The SPC563M Primer has run out of memory. This may occur when you try to dimension a huge array, or it may occur at any time if the computer is low on resources, since PrimerBasic uses memory internally. Be particularly careful when dimensioning arrays with variables.
●
Identifier too long
An identifier (variable name) is allowed to be only 31 characters long, including the $ for a string identifier. For dimensioned variables the number is one less.
●
No such variable
You have attempted to use a variable that has not been initiated.
●
Bad subscript
You have tried to access a dimensioned array beyond its dimensioned size.
●
Too many dimensions
You have tried to dimension an array with more than five dimensions.
●
Too many initialilers
In initialising a dimensioned array, you have tried to list more values than you have space for.
●
Illegal type
You have tried to use a string variable as the counter for a for loop.
●
Too many nested fors line
Maximum depth of FOR .. NEXT loops is 32. Exceeding this limit is probably due to problems with jumping out of FOR ... NEXT loops.
●
For without matching next
You have declared a FOR statement but not a matching NEXT.
Doc ID 15798 Rev 2 19/24
Errors UM0715
●
●
●
●
●
●
Next without matching for
You have declared a NEXT statement without a matching FOR.
Divide by zero
You have attempted to divide by zero. This is a mathematical error.
Type mismatch
You have entered a string expression where PrimerBasic was expecting a numeric expression, or a numeric expression where it was expecting a string.
Input too long
Input lines can be a maximum of 1023 characters long. Lines longer than this are almost certainly either errors or malicious attempts to exploit the system, so they are rejected.
Bad value
There has been an internal overflow. Usually this is caused by trying to calculate with ridiculously large value like 10 trillion.
ERROR
Unspecified error has occurred.
20/24 Doc ID 15798 Rev 2