Skip to content

Language Reference, Error Messages

Andreas AFENTAKIS edited this page Nov 16, 2025 · 9 revisions

FBASIC Error Messages Manual

The FBASIC system raises a comprehensive set of messages to help developers debug their code and address operational issues. These messages are primarily divided into Errors and Exceptions, with a third specialized category for SQL Data Adapter Errors.


Errors

Errors (prefixed with 'E') generally indicate syntax issues, semantic problems, or logical flaws that the FBASIC interpreter detects while compiling or executing the program code. These typically relate to language structure, incorrect use of keywords, undeclared variables, collection/loop mismatches, or issues interacting with required components like Object Handlers. Resolving these errors requires a direct correction to the program's source code or its immediate execution environment, such as ensuring all labels and collections are correctly named and defined.

Code Error Message Template Description
E001 This is a user defined error message. Programmer can raise it using the ERROR statement of the Event's Library
E100 The Request For Object Handler is not installed ({context},{group},{name}) A required component for fetching a specified object is missing or not available.
E101 Cannot get object for: ({context},{group},{name}) The system failed to retrieve the requested object, even if the handler is present.
E102 Expecting {tok}, got {lastToken} A syntax error where the parser expected a specific token (e.g., keyword, identifier, separator) but found something else.
E103 Unexpected end of program The program terminated prematurely, often due to an unclosed block or missing statement.
E104 Expecting new line, got {lastToken} A statement or command was not properly terminated.
E106 Expecting keyword, got {keyword} The wrong keyword was used in a specific context.
E107 Cannot find label named {name} A target for a GOTO or GOSUB statement does not exist in the program.
E108 Assertion fault An internal consistency check within the FBASIC engine failed.
E109 There is no File Handler Installed. {more} [E109] The system lacks the mechanism needed to gain file access.
E110 Collection: {collectionName} not found. A named collection intended for use (e.g., in a FOREACH) is not defined.
E111 Undeclared name {lex.Identifier} An identifier (variable, collection, etc.) was used without being declared.
E112 Undeclared entity({entityType}) {entity}. {moreText} [E112] Specifically, an entit (eg variable, collection, etc) was used before it was properly defined or initialized.
E113 Unexpected token: {lastToken} in primary! A syntax issue encountered while parsing a simple expression (a 'primary').
E114 FOREACH {collectionName} without corresponding ENDFOREACH {collectionName} statement A loop structure is unbalanced (missing the closing statement).
E115 Cannot jump to next token {tok} An internal parser error when attempting to continue processing.
E116 EOF found trying to jump to next token {tok} The program ended unexpectedly while the parser was looking for a specific token.
E117 {name} is a function, cannot be declared as variable name A name collision where an attempt was made to declare a variable using a reserved function name.
E118 CALL return's error: {subResult.errorText} An external component invoked by a CALL statement returned an error.
E119 SDATA collections supporting only the field name ITEM A limitation or requirement for Simple Data (SDATA) collections was violated.
E120 Collection for {name} is empty/out-of-ForEachLoop An attempt was made to access the current item of a collection outside a FOREACH loop or when the collection holds no elements.
E121 Found RETURN without corresponding GOSUB A RETURN statement was executed without a preceding GOSUB call to establish a return address.
E123 Expecting Value or Identifier, got {lastToken} An expression expected either a literal value or a variable name but received an incorrect token.
E124 {forbittenItem} not permitted. Use LET to assign the result value and use the variable An operation result was used directly where only a variable holding the result is allowed; requires explicit assignment via LET.
E125 Wrong number of arguments. Expected {argNo}. {syntax} A function or procedure call provided an incorrect count of parameters.
E126 Wrong argument(s) type. Check argument: {argNo}. {syntax} The data type of an argument passed to a function/procedure is incorrect.
E127 Wrong referred type. Expected: {expectedType}. {syntax} A reference (e.g., a pointer or object) was of an unexpected type.
E128 Request object error. An object expected but got null. A routine or handler expected a valid object reference but received a null value.
E129 {whatIsEmpty} is empty A data structure or source required for an operation contained no data.
E130 {whatIsOutOfRange} is out of range. {more} An index, value, or parameter exceeded its acceptable minimum or maximum bounds.
E131 Inline IF cannot contain IF. Use AND instead. A restriction on the complexity of conditional logic within an inline IF statement.
E132 Internal error. {moreText} A catch-all for errors within the interpreter's internal logic that are not covered by other specific codes.
E133 {what} is already defined. {more} [E133] The identifier or the item is already defined and cannot redefined.
E134 Notation error. {what} [E134] Error parsing the notation inside the Square brackets

Exceptions

Exceptions (prefixed with 'X') often represent runtime errors or severe internal issues that are more difficult to recover from than standard errors, sometimes leading to a fatal crash. They include problems with internal data adapter configuration, memory access (like missing variables), or fundamental issues with type conversion and operation logic. Exceptions also cover basic structural errors in complex expressions, such as mismatched brackets or forbidden operations between incompatible data types like non-additive string operations.

Code Exception Message Template Description
X100 Data adapter: ${adapter.name} exists. Cannot add more than once. An attempt was made to register a data adapter with a name that is already in use.
X101 Variable with name {name} does not exist. A variable was referenced in a context (often an internal utility) where it was expected to be available, but it was not found.
X002 FATAL ERROR FOUND An unrecoverable error occurred, likely forcing the program to halt immediately.
X003 Found opening bracket but expected closing Mismatched parentheses or brackets in an expression or structure.
X004 Found end of line but expected closing bracket A line break was encountered before an opening bracket was properly closed.
X005 Identifier inside brackets must contains a dot character A rule for structured/qualified identifiers within bracket notation was violated (e.g., object.property).
X006 Bracket Identifier cannot starts or ends with dot character Qualified identifiers in brackets must not have leading or trailing dots.
X007 Can only do unary operations on numbers. An attempt was made to apply a unary operator (like negation) to a non-numeric type.
X008 Unknown unary operator. An unrecognized operator was used in a unary context.
X009 Cannot do binop on strings(except +). String data type only supports the concatenation (+) binary operation; all others are forbidden.
X010 Unknown binary operator. An unrecognized operator was used between two values.
X011 Cannot convert {fromType} to {toType}. A type casting failure where the system could not safely or logically change the data from one type to another.
X012 FATAL Error ({source}). {text} A detailed unrecoverable error reporting the source of the failure.

Errors from SQL Data Adapter

This is a specialized category of errors (prefixed with 'S') raised by the component responsible for interacting with SQL databases. They indicate issues specifically related to database operations, data type compatibility between FBASIC and SQL, and the usage of the built-in SQL() function.

Code Error Message Template Description
S001 Unsupported data type {type} The SQL adapter encountered a data type that it is not programmed to handle or map to an FBASIC type.
S002 SQL() takes only one argument The built-in function for executing SQL commands was called with too many or too few arguments (it expects the SQL string as a single argument).
S003 Name: {name} is missing from {cursorName} A required column name was not found in the result set (cursor) returned by the database query.
S004 All names for {cursorName} are missing. Requested is: {name} The cursor cannot report the column names, maybe is not opened. Check for SQL errors

Clone this wiki locally