BBC BASIC for SDL 2.0
BBC BASIC for Windows
The following error messages can be reported by the program editor, compiler
and Integrated Development Environment:
There was insufficient memory to copy something to the clipboard. This should not
happen in normal circumstances.
The requested initial user memory
could not be allocated. Try freeing up memory by closing other programs.
A file specified in a REM!Resource compiler directive
could not be buffered in memory. This should not happen in normal circumstances.
The Compile utility could not append your program
to the executable file. Most likely the disk is full.
There was insufficient memory for the screen character map. This should not happen
in normal circumstances.
The specified file could not be created. Either the disk is full, a read-only or locked file of
the same name exists, or you do not have write access to the relevant directory (folder).
The colour palette could not be created. This should not happen in normal circumstances.
There was insufficient memory for BASIC's screen bitmap. Try freeing up memory by
closing other applications; if that fails, reboot your computer.
The memory required for a temporary buffer used during compilation could not be allocated.
This should not happen in normal circumstances.
The specified embedded file could not be crunched. To find out why not, try compiling it
separately using the same crunch options.
The character encoding of the program being
loaded could not be determined, for example both ANSI and UTF-8 strings
appear to be present; the required selection should be made manually. This warning will
not be issued again if the program is re-loaded.
The Compile utility could not embed a
specified resource file in the executable. Most likely the disk is full.
The Tutorial command could not locate the
tutorial file BBCTUTOR.CHM. If necessary re-install BBC BASIC for Windows
from your master disk.
The Help Topics command could not locate the
help file BBCWIN.CHM. If necessary re-install BBC BASIC for Windows
from your master disk.
The selected icon could not be found in the specified file.
The Windows XP™ Visual Styles manifest could not be read. Suspect a corrupted
BBCWIN.EXE or BBCWIN6.EXE file.
The clipboard could not be opened. This should not happen in normal circumstances.
The specified file could not be opened. Most likely it does not exist in the specified place
or you don't have read access to the relevant directory (folder).
The file containing the selected icon could not be opened. Most likely it does not exist in the specified place
or you don't have read access to the relevant directory (folder).
The specified temporary file could not be opened. Most likely it does not exist in the specified
place or you don't have the necessary access rights.
An attempt to print your program failed.
A file specified in a REM!Resource compiler directive
contains an invalid resource that could not be added to the executable.
The specified file could not be read. Suspect a corrupted or damaged disk.
The file containing the selected icon could not be read. Suspect a corrupted or damaged disk.
The selected icon resource could not be read. Suspect a corrupted or damaged file.
The code-signing utility could not be run; most likely the path or filename specified
in the registry is incorrect. The relevant key is:
HKCU\Software\R T Russell\BBC BASIC for Windows\Settings\SignTool
The resources (e.g. icon) of the specified file could not be updated. Either the file does not exist,
has the wrong format or could not be opened for writing.
The specified file could not be written. Most likely the disk is full.
The Compile utility could not store the
selected icon in the executable file. Most likely the disk is full.
The crunch option of the Compile utility
encountered a syntax error within some assembly language code.
The crunch option of the Compile utility
encountered a bad assembler label, for example ..label (two dots).
The crunch option of the Compile utility
encountered a calculated line number, e.g. GOTO (100+offset%). If you use
calculated line numbers you must deselect the Concatenate lines option.
The crunch option of the Compile utility
encountered a REM!Fast compiler
directive specifying an invalid variable name, for example containing
an illegal character.
The crunch option of the Compile utility
encountered a REM!Keep compiler
directive specifying an invalid variable name, for example with fewer than
three characters.
The crunch option of the Compile utility
detected a line continuation character
without another at the beginning of the next line.
The crunch option of the Compile utility
detected mismatched quotation marks ("). There must always be an even number
in the line.
The crunch option of the Compile utility
detected an ENDCASE,
ENDIF, OTHERWISE
or WHEN not at the start of a line.
When selecting files for embedding in an executable (Compile
utility) the directory was changed. Only files in the @dir$ or @lib$ directories, or
their subdirectories, can be embedded.
A file specified in a REM!Resource compiler directive
does not have the correct signature for a .res format file.
The Help Topics or
Tutorial command could not access the
HTML Help system. On Windows™ 95 and NT 4.0 you may need to
install Internet Explorer version 4 or later to rectify this error.
There is insufficient memory to CHAIN
a program file, or to change the value of PAGE.
There is insufficient memory to crunch the specified embedded file.
There is insufficient memory to run the crunch option of the
Compile utility. Increase the value of
HIMEM or change the
initial user memory setting and
re-start BBC BASIC.
The program file you are attempting to load does not have a valid tokenised
or ASCII format. The file may have been corrupted.
An attempt to concatenate two program lines, by typing backspace when the
cursor is at the beginning of the line, would cause the maximum line length to be exceeded.
When tokenising a program line, i.e. converting it from ASCII to internal
format, the maximum line length was exceeded and the remainder of the line was
discarded. This can happen when loading a program from a file or when typing
(or pasting) it in.
There is insufficient memory to Load or
Insert a file. Increase the value of
HIMEM or change the
initial user memory setting and
re-start BBC BASIC.
There is insufficient memory for your BASIC program. Increase the value of
HIMEM or change the
initial user memory setting and
re-start BBC BASIC.
The code-signing utility returned a failure status; most likely the parameters specified
in the registry are incorrect (where the path/filename of the executable to be signed is
given as "%s"), or the authorising server couldn't be contacted. The relevant key is:
HKCU\Software\R T Russell\BBC BASIC for Windows\Settings\SignParm
You have attempted to add too many embedded files in one go. Add the files
in smaller groups.
The following error messages can be reported while your BASIC program is running:
The following untrappable ('fatal') errors have an error code of zero:
Strictly speaking 'Bad program' does not have an error code. It leaves
ERR and
ERL unchanged.
This is something of a 'catch all' error message. It originates from
the Operating System and occurs when it thinks you
are trying to illegally write to or delete a file or directory.
The most common case of this error is trying to write to a file that
was opened for input with
OPENIN. If you wish to write to an existing
file, you should open it for read/write with
OPENUP.
On a network system, this error may indicate that you are trying to
access a file that has been locked by another user. For example,
two users trying to open the same file with OPENUP will give rise to
this error.
You will also get this error if you try to remove a directory which
has files in it. If you wish to remove (delete) a directory you must
first delete all the files in it.
Before BBC BASIC calculates trigonometric functions
(SIN, COS,
etc.) of very large angles the angles are reduced to ±
PI radians. The
larger the angle, the greater the inaccuracy of the reduction, and
hence the result. When this inaccuracy becomes unacceptable, BASIC
will issue an 'Accuracy lost' error message.
Although BBC BASIC programs should always allocate memory
'properly' (e.g. using the DIM statement
or by lowering HIMEM) many programs
written for the BBC Micro (and some written for other versions of BBC BASIC)
contain references to 'absolute' memory addresses. Such programs would be very
likely to crash BBC BASIC for Windows or BBC BASIC for SDL 2.0
since the addresses usually aren't valid. For this reason, attempts to access
memory addresses below &10000 are trapped and result in the
'Address out of range' error rather than a crash.
The address is checked in the case of indirection
(i.e. the ?, ! and $ operators), when setting the values of
PAGE and LOMEM, in the
CALL, SYS and
USR statements, and in the
*LOAD and *SAVE
commands.
This error also results when the assembler detects that
the code pointer has reached the specified limit value L%.
This error indicates that a procedure or function has been called incorrectly, for example
by adding a space between the keyword FN and the function name:
PRINT FN mean(5,6)
DEF FNmean(A,B) = (A + B) / 2
This error occurs when a 'star' (OSCLI)
command is not correctly structured, or when the Operating System cannot understand
a filename or file specification. For example, if the memory address is omitted
from a *LOAD command, the 'Bad command'
error will result.
Note that if a 'star' command is not recognised by BBC BASIC it is passed
to the Operating System for execution. Should it not be a valid GUI or console
command (for example it was mis-typed) the 'Bad command' error will not be
generated but instead an error will be displayed
at the Command Prompt. This is not trappable by a BASIC program, and may
appear on the screen only fleetingly, if at all.
This error is produced when there is a mistake in a
DIM statement. For example, if an
array suffix is negative a 'Bad DIM statement' error will result:
DIM table(20,-10)
This error will also result if you attempt to re-dimension an array which has
already been declared, or redeclare a structure which has already been declared:
100 DIM A(123)
110 DIM A(100)
120 DIM my_struct{x%,y%}
130 DIM my_struct{A,B}
Note that you can repeat
an array or structure declaration so long as the dimensions or format respectively are
identical to those specified when the array/structure was first declared. In this case
the contents of the array or structure remain unchanged: they are not initialised.
This error indicates that the Operating System could not understand a
directory (folder) name, for example it contained illegal characters.
For example, the command
*CD \:\
would give rise to the 'Bad directory' error.
This error is reported if the Operating System could not understand a
device name.
The variable in a
FOR...NEXT
loop must be a numeric variable. If
you use a constant or a string variable this error message will be
generated. For example, the following statements are not legal.
20 FOR name$=1 TO 20
20 FOR 10=1 TO 20
Hexadecimal numbers can only include the characters 0 to 9 and A to F;
similarly binary numbers can only contain the digits 0 and 1. If
you try to form a hexadecimal or binary number with other characters this error will
occur. For example:
n = &OF
n = %21
(in the first example a letter O was used where the figure 0 was intended).
This error is generated if the key number in a
*KEY command is greater
than 24.
This error occurs if a module loaded with the INSTALL or
CALL statement has an incorrect format, i.e. is
anything other than a valid internal format (tokenised) program file.
This is similar to the 'Bad program' error except
that 'Bad library' is trappable with ON ERROR
but 'Bad program' is not.
This error is generated if an attempt is made to select a
MODE number greater than 33.
This error is generated if one or more variables specified in the
MOUSE statement is invalid,
for example is a string variable rather than a numeric variable.
This error is generated if a file specification exceeds 255 characters in length
(or would exceed 255 characters after a default extension, e.g. .BBC, is added).
When a program is run, or is
CHAINed from another program,
BBC BASIC checks to see that it
has the correct internal (tokenised) format; if not, the 'Bad program' error is generated.
This error can be caused by attempting to run a file with an inappropriate
format (e.g. a program in ASCII text format) or by corrupting the program in memory
(machine code programmers beware). 'Bad program' is an untrappable error and does
not have an error code (by definition there is no program present which could
make use of such a code).
The most likely cause is that the program file is in ASCII (text) or Acorn format, rather
than the correct internal (tokenised) format. In that case you can convert the file to the
wanted format by Loading it into the program
editor and Saving it As a BBC BASIC (.BBC) file.
File names (etc.) in 'star' (OSCLI) commands
may optionally be enclosed in quotes; this is mandatory if the filename
includes a space. The 'Bad string' error will occur if the quotes are unmatched.
The following example would give rise to this error:
*DEL "GRAPHS
This error is also generated if there is insufficient space for the key string in
a *KEY command.
This error is generated if you attempt
to access an element of an array whose subscript is negative or greater
than the dimension specified in the
DIM statement. Both lines 20 and 30 of the following example would give rise to this error:
10 DIM test(10)
20 test(-4)=20
30 test(30)=10
This error occurs when an array is referenced but where the use of an array
is inappropriate, or when an undimensioned array is referenced (for example
after an array is made LOCAL or
PRIVATE but before it is
re-DIMensioned).
This error occurs when a structure is referenced but where the use of a structure
is inappropriate, or when an undeclared structure is referenced (for example
after a structure is made LOCAL or
PRIVATE but before it is redeclared with
DIM).
The following example would give rise to this error:
DIM mystruct{x,y,z}
mystruct{} = 1
This error is generated when BBC BASIC is unable to find a
FOR statement corresponding
to the current NEXT statement.
BBC BASIC will 'pop' FOR ... NEXT loops in an attempt to match the variable
name specified after NEXT, but if no matching FOR is found the 'Can't match FOR'
error results. For example:
10 FOR A% = 1 TO 10
20 FOR B% = 1 TO 10
30 NEXT C%
It is also generated if an EXIT FOR var statement is
encountered and the specified variable does not match that of an enclosing FOR...NEXT loop.
This error is generated if BBC BASIC encounters a
RESTORE DATA statement but is unable to match it
with a corresponding LOCAL DATA statement.
This can happen as a result of jumping out of a loop in the meantime.
Note that when LOCAL DATA is used inside a FOR...
NEXT, REPEAT...
UNTIL or WHILE...
ENDWHILE loop, or inside a user-defined
function, procedure
or subroutine, the data pointer is automatically
restored on exit (there is no need to use RESTORE DATA).
This error is generated if a device (e.g. a disk drive) accessed by
BBC BASIC appears not to be ready. This is most commonly
caused by attempting to access a floppy disk when no disk is in the drive,
or when the disk is seriously damaged.
This error is generated when an attempt is made to play a MIDI file using
the *PLAY command, but there is no
suitable MIDI device available, or when the SOUND
statement is used and no suitable wave output device is available. This is most
commonly caused by the device already being in use (for example as the result
of a previous *PLAY command, or when another program is using the sound system)
but may also indicate that no suitable sound card is installed. A
currently-playing MIDI file can be aborted using
SOUND OFF.
If you want to avoid this error, you can incorporate the following code at the start of your
program:
SoundOK% = TRUE
ON ERROR LOCAL SoundOK% = FALSE
IF SoundOK% SOUND 1,0,0,1
RESTORE ERROR
This will set the variable SoundOK% to TRUE
if it is safe to use the SOUND statement and to FALSE
if not. All subsequent SOUND statements in your program should be made conditional
on SoundOK% as follows:
IF SoundOK% SOUND ..........
This error is generated if there is insufficient room for an array or structure when
you try to declare it, or if an attempt is made to reserve a negative amount of
memory. For example,
DIM A% -2
If there is insufficient room for an array or structure, you may be able to increase the
memory available to BBC BASIC by raising the value of
HIMEM. Failing that see the
Memory management section for hints
on how to reduce memory usage.
This error is generated if a fault occurs while accessing a disk. It
will occur, for example, if the contents of the disk have been corrupted
and a file is unreadable.
This error will occur if there is insufficient room on the disk for
the file being written to it.
This error is generated if an attempt is made to write to a disk
which is write protected, for example a floppy disk which has had its
'write protect' tab moved to the 'protect' position.
Mathematically, dividing by zero gives an infinitely large answer. The
computer is unable to understand the concept of infinity (it's not
alone) and this error is generated. If there is any possibility that
the divisor might be zero, you should test for this condition before
carrying out the division. For example:
200 IF divisor=0 THEN PROC_error ELSE...
This error is also generated by the DIV and
MOD functions if the second value is zero.
This error is generated by pressing the <Esc> key. You can trap this,
and other errors, by using the
ON ERROR statement. You can inhibit
the generation of the 'Escape' error by using
*ESC OFF. The <Esc>
key then returns the ASCII value of escape (&1B). *ESC ON restores
the default action of the <Esc> key.
This error will be generated if the EXP function would result
in a value larger than the maximum number which can be handled by BBC BASIC.
This error is generated if you try to rename a file, and a file
with the new name already exists, or to create a directory, and
the specified directory already exists.
This error will occur if you try to
*COPY,
*DELETE (or
*ERASE),
*DISPLAY,
*EXEC,
*LIST,
*LOAD,
*LOCK,
*PLAY,
*RENAME,
*SPOOLON,
*TYPE,
*UNLOCK,
CHAIN or
INSTALL a file which
does not exist.
It will also occur if you try to
*SAVE,
*SCREENSAVE
or
*SPOOL
to a file in a directory (folder) which does not exist or is not writable by you.
Finally, it can occur if you try to
*CHDIR to a non-existent directory,
*RMDIR a non-existent directory or
*MKDIR in a directory which doesn't
exist or which is not writable by you.
Note that this error is not generated if you try to open the file
with OPENIN,
OPENOUT or
OPENUP. In these cases the
function returns the value zero, but no error is generated.
This error indicates that too many or too few arguments have been
passed to a procedure or function, or an invalid parameter has
been used. See the sub-section on
Procedures and Functions
for more details.
It is also generated if a SYS statement has
too many parameters.
This error is generated if a specified channel number does not correspond to an
open file. This may be because the file has been closed, or was never opened
successfully, possibly because the
OPENIN,
OPENOUT or
OPENUP function failed.
The 'Invalid channel' error is also generated if PTR#
or EOF# is used with a channel opened to a
communications port (e.g. a serial port).
This assembly language error
is generated if you try to perform
a relative (short) jump to a destination which is more than +127 or −128 bytes
away. Except in the case of LOOP and JECXZ statements (and their variants),
you can solve this problem by specifying a near jump:
jz near label
This error is also generated (rather misleadingly) when an assembly language
statement requires an 8-bit (one byte) operand but the value supplied won't fit in
8 bits. For example the statement:
add al,1000
would generate the error, because the decimal value 1000 is too big to fit in a single byte.
Logarithms for zero and negative numbers do not exist. This error
is generated if you try to calculate the LOG
or LN of zero
or a negative number, or raise a negative number to a non-integer power.
This error is generated if BBC BASIC did not see a comma where one was expected.
The following example would give rise to this error.
20 PRINT TAB(10 5)
This error message is generated if BBC BASIC did not see
a double-quote where one was expected. The following example would
give rise to this error.
10 name$="Douglas
This error is generated if BBC BASIC did not see a closing bracket where one was expected.
The following example would give rise to this error.
10 PRINT SQR(num
This error will occur if BBC BASIC did not see a hash symbol
(#, or a pound symbol £ in MODE 7) where one was expected. The following
example would give rise to this error.
CLOSE 7
This error will occur if there is no backslash (\) symbol at the beginning of a continuation
line. See the Line continuation section for
details. The following example would give rise to this error.
FOR I% = 1 TO \
N% : PRINT I% : NEXT
If you receive this error as the result of using backslash as an assembler
comment delimiter, change the
backslash to a semicolon (;).
This error is generated if BBC BASIC cannot locate an
ENDCASE statement to terminate
the current CASE statement.
This error is generated if BBC BASIC cannot locate an
ENDIF statement to terminate
the current multi-line IF ...
THEN statement.
This error is generated if BBC BASIC encounters a
CASE statement with the
OF keyword missing.
This error message is generated if BBC BASIC encounters a
FOR...NEXT
loop with the TO part missing.
This error is generated if a statement does not begin with a keyword,
but neither is it an assignment to a variable; in other words BBC BASIC
is unable to make any sense of the statement. This is most
likely to result from mistyping a keyword.
This error is generated by the assembler
if, during the first pass of an assembly
(OPT 0, 1, 4, 5, 8, 9, 12 or 13), a label is
found to have an existing non-zero value. This is most likely to be
caused by the same label being used twice (or more times) in the
program.
This error is generated if BBC BASIC attempts to calculate
the square root of a negative number. It is possible for this error
to occur with
ASN and
ACS as well as
SQR.
90 num=-20
100 root=SQR(num)
This error is generated if a *FLOAT 64 command is
executed but no numeric data processor is available. This will only happen with older
PCs using an 80386 or 80486SX CPU (without an 80387 or 80487SX coprocessor) since all later
PC CPUs contain a numeric data processor as standard.
This untrappable error indicates that all the memory available to BASIC
was used up whilst a program was running. You may be able to increase the
memory available to BBC BASIC by raising the value of
HIMEM. Failing that see the
Memory management section for hints
on how to reduce memory usage.
This error is generated if BBC BASIC encounters a
function call (FN) or
procedure call (PROC) but no function or procedure
with that name has been defined (DEF).
It is also generated if an attempt
is made to get a pointer to a PROC or FN before
any conventional function or procedure calls have been made.
This error is generated if the font name (font file in the case of BBC BASIC for SDL 2.0)
given in a *FONT or
*PRINTERFONT command
cannot be recognised. In practice BBC BASIC for Windows may choose an alternative
font rather than issuing this error.
This error is generated if BBC BASIC tries to
GOTO,
GOSUB,
TRACE or
RESTORE to a non-existent line number.
This error is generated if the printer name given in a
*PRINTER command
cannot be recognised. Printer names are not case sensitive, but
otherwise must be precise.
This error is generated if an Operating System (Windows™ or SDL 2.0) API function called by name
with a SYS statement (or called from
assembler code) cannot be recognised.
This may be caused by the function name being mistyped (function names
are case-sensitive) or because the specified function is not exported by any of the shared libraries
loaded by the process.
This error is generated if you try to access the value of a variable which
has not yet been created. See the
Creation of variables section for details of how variables may be
created.
This error is generated if you try to define a variable as
LOCAL or
PRIVATE outside of a procedure
or function. If you forget to put multi-line
function definitions out of harm's way at the end of the program you
may get this error message (see the sub-section on
Procedures and Functions
for more details).
This error is generated if BBC BASIC encounters a
NEXT statement but is unable
to match it with a corresponding FOR statement.
This can be caused by
having 'jumped out of a loop' in the meantime (see the
sub-section on Program Flow Control
for more details).
It is also generated if an EXIT FOR statement is
encountered when not in a FOR...NEXT loop.
This error is generated if BBC BASIC encounters an
end-of-function statement (i.e. one beginning with an 'equals' sign) but is
not currently within a function. If you forget to put
multi-line function definitions out of harm's way at the end of the
program you are very likely to get this error message (see the sub-section
on Procedures and Functions
for more details). This can also be caused by having 'jumped out of a loop'
whilst within a function.
This error is generated if BBC BASIC encounters an
ENDPROC but is not currently within
a procedure. If you
forget to put multi-line procedure definitions out of harm's way at
the end of the program you are very likely to get this error message
(see the sub-section on Procedures
and Functions for more details). This can also be caused by having
'jumped out of a loop' whilst within a procedure.
This error is generated if BBC BASIC encounters an
UNTIL statement but is unable
to match it with a corresponding REPEAT
statement. This can be caused by
having 'jumped out of a loop' in the meantime (see the
sub-section on Program Flow Control
for more details).
It is also generated if an EXIT REPEAT statement is
encountered when not in a REPEAT...UNTIL loop.
This error is generated if BBC BASIC encounters a
RETURN
statement but is unable to match it with a corresponding
GOSUB or
ON statement. This can be caused by
having 'jumped out of a loop' in the meantime (see the
sub-section on Program Flow Control
for more details).
This error is generated if BBC BASIC encounters an
ENDWHILE statement but is unable
to match it with a corresponding WHILE
statement. This can be caused by
having 'jumped out of a loop' in the meantime (see the
sub-section on Program Flow Control
for more details).
It is also generated if an EXIT WHILE statement is
encountered when not in a WHILE...ENDWHILE loop.
This error is generated if a number is entered or calculated which is
too big for BBC BASIC to cope with. The range of
values of a 32-bit integer variable (e.g. a%) is from −2147483648 to +2147483647
and the range of values of a 64-bit integer variable (e.g. a%%) is from
−9223372036854775808 to +9223372036854775807.
The range of values of a 40-bit floating-point variable is approximately
−3.4E38 to +3.4E38, the range of values of a 64-bit floating-point
variable (e.g. a#) is approximately −1.7E308 to +1.7E308 and the range of values
of an 80-bit variant variable is approximately −1.1E4932 to +1.1E4932.
This error is generated if the keyword OF is not
the last thing on the line in a CASE statement.
OF cannot even be followed by a REMark.
This error is generated if BBC BASIC encounters a
RESTORE ERROR statement but is
unable to match it with a corresponding
ON ERROR LOCAL statement. This can be caused by
having 'jumped out of a loop' in the meantime (see the
sub-section on Program Flow Control
for more details).
This error is generated if, in an
ON GOTO/GOSUB/PROC statement,
the control variable was less than one or greater than the number of
entries in the ON list, and there was no
ELSE option. The first example below will
generate an 'ON range' error, whilst the second is correct:
10 num=4
20 ON num GOTO 100,200,300
10 num=4
20 ON num GOTO 100,200,300 ELSE 1000
This error is generated if an
ON statement is misformed.
For example:
20 ON x TIME=0
This error is generated if your program tries to
READ more items of data than there are in
the DATA list(s). You can use
RESTORE
to return the data pointer to the first DATA statement (or to a particular
line with a data statement) if you wish.
This assembly language error is generated
when an inappropriate mixture of 16-bit and 32-bit operands is used in
the same instruction. For example whilst the following two instructions are both valid:
mov ax,bx
mov eax,ebx
the following (non-existent) instructions will give rise to the 'Size mismatch' error:
mov ax,ebx
mov eax,bx
Certain
assembly language instructions
are ambiguous as to whether a byte (8-bit), word (16-bit) double-word (32-bit) or
quad-word (64-bit) value is to be acted upon. In these cases the data size must be explicitly
stated as byte, word, dword or qword (or byte ptr,
word ptr, dword ptr, qword ptr). For example:
inc byte [ebx]
mov dword [count],0
add word [sum],3
If this is not done, a 'Size needed' error will be generated.
This error is generated if the STEP
value in a FOR ...
NEXT statement is zero. For example:
FOR N% = 1 TO 10 STEP 0
This error is generated if a string is longer than the allowed maximum,
for example the maximum length of a filename or
OSCLI (*) command is
255 characters; the maximum length of a string passed to
VAL is 65535 characters.
This error is generated if a keyword was recognised, but the rest of
the statement or function was meaningless or incomplete.
It is also generated if an illegal character is encountered in a
variable name or value.
This error is generated if you try to open more than eight files or
four communications ports (with
OPENIN,
OPENOUT or
OPENUP) at any one time.
To avoid this error make sure that you CLOSE
each file as soon as you have finished with it.
See Opening files and
Serial input/output for more details.
This error is generated when a number was expected but a string was
encountered, or vice-versa. For example:
10 TIME = "Midnight"
20 Length = LEN(A%)
This error can be generated when the
actual parameters and the formal parameters of a function or procedure
do not correspond (see
Procedures and functions for more details).
The Type mismatch error will also result when array arithmetic
is performed but the dimensions of the arrays are not compatible.
This error is generated if the Operating System reports an error condition which BBC BASIC
does not recognise. You may be able to discover more information about the error by using
the code below:
BBC BASIC for Windows:
SYS "GetLastError" TO ern%
PRINT ern%
If you prefer you can convert the error number to a string:
DEF FNerrorstring(ern%)
DIM buf% LOCAL 255
SYS "FormatMessage",&1000,0,ern%,0,buf%,255,0
= $$buf%
BBC BASIC for SDL 2.0:
DEF FNsdlerror
LOCAL message%%
SYS "SDL_GetError" TO message%%
IF @platform% AND &40 ELSE message%% = !^message%%
= $$message%%
This error is generated if a WHEN or
OTHERWISE clause of a
CASE statement does not appear
at the very start of a program line.
©
Richard Russell 2021