Error Messages

Sometimes when using Liberty BASIC, there are error messages presented while compiling (called compile-time errors) and while running a program (called run-time errors).

Here are some compile-time errors:

Syntax error - This means that some error was made while typing in a BASIC statement. You should examine the line and look for typing mistake.

Type mismatch error - This means that you tried to use a string where a number should be used, or a number where a string should be used.

Here are some run-time errors:

Branch label [exampleLabel] not found - The program tried to GOTO or GOSUB to a label that doesn't exist.

Float divide by zero exception - The program tried to divide a number by zero, which is not possible to do.

File filename not found - This error can occur when attempting to load a bitmap image from a disk file into memory using the LOADBMP statement, and when no file of the specified filename is found to exist.

Bitmap named bitmapname not found - This error can occur when attempting to save a bitmap from memory to a disk file using the BMPSAVE statement, or when attempting to use the DRAWBMP command, and a bitmap name is specified which doesn't exist in the program's memory.

Control type fonts are set with: !FONT face_Name width height - An error was made specifying the font for a control (controls which return this error include button, textbox, radiobutton, checkbox).

undefined struct: structname - An expression referred to the name of an undefined struct (see the help file for information about the STRUCT statement).

root.field.struct undefined - An expression referred to a field which is undefined for a struct which is defined (named root in this example).

Errors when using serial communications - There are a handful of run-time error messages which terminate program execution. These usually correlate to API function call failures that occur when attempting different operations. In this case, the error is reported by Windows, but the description of the reported error is generated by Liberty BASIC. Here is a list of the error messages:

    Port must be open
    SetCommState failed
    Unable to get DCB
    Output queue full
    Unable to send RTS
    Unable to clear RTS
    Unable to clear DTR
    Unable to set DTR
    Byte size too small
    Byte size too large
    Invalid port, or port not open
    Unable to get max port
    Unable to set break
    The device is already open
    The device identifier is invalid or unsupported
    The device's baud rate is unsupported
    The specified byte size is invalid
    The default parameters are in error
    The hardware is not available (is locked by another device)
    The function cannot allocate the queues
    The device is not open

The following run-time errors are indications of more subtle problems in Liberty BASIC. If you see one of these errors, send email to carlg@libertybasic.com describing in as much detail how the error happened. If you have BASIC code that can reproduce the error, please include it in your message.

    Index: n is outside collection bounds
    The collection is empty
    Object is not in the collection