About this page
This page collects two things in one place: structural limits built into the compiler
that no amount of correct-looking code can work around (Constraints), and the
compiler’s error messages with a plain-language recommendation for fixing each one
(Error Messages). If a message that has been encountered is not listed here, it is
very likely a normal syntax error (a missing Then, a mismatched bracket, an
undeclared variable) rather than a structural limit - re-check the line the compiler
points to.
Constraints
| Constraint | Limit | Notes |
|---|---|---|
|
Bitwise AND/OR complexity |
At most two |
More than two fails with "More than two AND/OR statements - reduce complexity." Split the comparison across two or more lines. See Conditions. |
|
Bitwise comparisons using multiple system bit variables |
Combining more than one system-generated bit variable with relational operators or braces in one comparison |
Risks a silently wrong result; warns "Potential invalid BIT comparison error when using complex Bitwise logic." Suppressible
with |
|
Calculation complexity |
At most 40 elements (operators and operands combined) in one calculation |
Fails with "TYPECHECKSIZE exceed - reduce complexity." Break the calculation into steps using intermediate variables. See Setting Variables. |
|
Sub/Function parameter count |
At most 50 parameters per call |
Fails with "Maximum number of parameters (50) exceeded." See Subroutines / Functions. |
|
DATA block value size |
0x3FFF (14-bit PIC families) / 0xFFFF (PIC18, AVR) |
A value exceeding this for the target family fails to fit in one program-memory word. See DATA's Maximum Stored Value tables. |
|
Program memory pages (baseline/mid-range PIC only) |
2048 words per page; page 0 has a little less |
Each Sub, Function, the main body, and the interrupt handler must fit entirely within one page. The main body, the interrupt handler, and the automatic context save/restore code are always pinned to page 0. See Program Memory Pages. |
|
Direct array-load element count |
250 elements (chip RAM < 2048 bytes) or 255 elements (chip RAM >= 2048 bytes) |
Applies to the |
|
|
One |
A second |
|
AVRrc (reduced-core AVR) register pressure |
Byte variables only; no |
These chips have very limited registers. The compiler’s own recommendation when registers run out: "keep the code very simple." |
|
Table source item count |
Fixed capacity per table |
Fails with "Out of table space. Too many items in table source." Split the data across multiple tables. |
|
|
Step must be positive, in the range 0 to 0xFFFFFFFF |
A negative Step yields incorrect results and is not detected automatically. Suppressible with |
|
|
The To/From range must not cross zero - both bounds positive, or both negative |
Suppressible with |
|
Nested |
Each nested loop needs its own loop variable |
Reusing a loop variable already in use by an outer loop fails with "For index is already in use." |
|
|
Integer only |
|
|
|
No floating-point expressions |
A |
|
Pin direction control on 12-bit core chips |
Whole-port direction only |
12-bit core chips cannot set the direction of individual pins with |
|
|
Not supported directly |
Copy |
|
Alias byte locations |
Must be sequential |
An alias spanning multiple RAM locations for individual bit addressing requires those locations to be sequential. |
|
|
Mutually exclusive on the same variable |
Both set the variable’s location; a variable cannot use both. |
|
Bit variable arithmetic |
Not permitted |
Bit variables cannot be added or subtracted ("Illegal operation"). |
|
Bit variable comparisons |
|
No other relational operator ( |
|
Table text content |
ASCII 255 is reserved |
Cannot appear inside Table text. |
|
Overloading string-returning functions |
Not supported |
Subroutine/Function overloading (see Subroutines) works for other types, but not for functions that return a string. |
|
Interrupt handler assignment |
One handler per event |
Assigning a second handler to the same interrupt event fails with "A handler has already been defined for the event." |
|
Return-value syntax inside a plain |
Not permitted |
A |
|
Multi-bit |
Literal values only |
|
|
|
At most 64 values per |
A |
Error Messages
| Message ID | Message Text | Recommendation |
|---|---|---|
|
AliasToSelf |
Variable cannot be an alias to itself |
Point the |
|
ArrayNoDec |
Array/Function %Name% has not been declared |
Declare the array with |
|
ArrayTooBig |
The array %Array% is too large |
Reduce the array’s element count, or free RAM elsewhere so it fits. |
|
ArrayTypeInvalid |
Cannot set the type of an array |
Remove the explicit type from the array declaration; array element type is fixed by how it’s declared. |
|
ArrayAssignmentIncorrect |
%Name% array assignment is incorrect |
Check the assignment syntax against the array’s declared type and dimensions. |
|
ASMParamMismatch |
Number of parameters does not match |
Check the operand count against the instruction’s expected form in the target chip’s instruction set. |
|
AssemblerNotFound |
Could not start the external assembler |
Verify the assembler path in Preferences/Tool Variables, and that the executable exists. |
|
AssemblyFailed |
Assembly failed due to the following errors: |
Read the assembler errors that follow this line; they identify the real problem. |
|
BadAliasSize |
Size of alias variable (%size%) does not match number of RAM locations for [%locations%]%target% variable, increase aliased bytes |
Increase the alias’s byte count to match the target variable’s size. |
|
BadBitRead |
Cannot read bit %bit% of %var% |
Check that the bit number is valid for the variable’s type/size. |
|
BadBitSet |
Cannot set bit %bit% of %var% |
Check that the bit number is valid for the variable’s type/size. |
|
BadBrackets |
Brackets do not match up |
Check for a missing or extra opening/closing bracket on the line. |
|
BadADCConstName |
Invalid constant name: %const%. Parameter should be ANx or ANxx |
Use the chip’s actual analog-channel constant name, e.g. |
|
BadCast |
Cannot cast from %from% to %to%, cast here must be from larger to smaller type |
Reverse the cast direction, or use an intermediate variable of the larger type. |
|
BadCommandType |
%command% command cannot be used on variables of type %type% |
Use a variable of a supported type for this command, or convert the value first. |
|
BadConfig |
Configuration setting not valid: %option% |
Check the |
|
BadConstName |
Invalid constant name: %const% |
Rename the constant - it must be a valid identifier and not a reserved word. |
|
BadDirection |
Invalid pin direction, expected In or Out |
Use |
|
BadIntEvent |
Invalid interrupt event: %event% |
Check the event name against the chip’s supported interrupt events. |
|
BadOnType |
Bad mode: Found %found%, expected Interrupt |
Check the |
|
EEBadORG |
Bad EEPROM location overwriting %loc% |
Adjust the EEPROM data’s address so it does not overlap another dataset. |
|
BadParam |
Incorrect parameter syntax: %sub%. Correct syntax is %correct% |
Match the call to the syntax shown in the message. |
|
BadParamCount |
Parameter count mismatch |
Check the number of arguments passed against the Sub/Function’s declaration. |
|
BadParamsSet |
Incorrect parameters in Set, expected: Set variable.bit status |
Use the form |
|
BadPWMFreq |
Invalid PWM Frequency value |
Choose a PWM frequency achievable at the chip’s clock speed; see the PWM documentation for valid ranges. |
|
BadSetStatus |
Invalid status in Set command: %status% |
Use a valid status keyword (e.g. |
|
BadStringConst |
String constant cannot be first in condition |
Put the variable or function call first in the comparison, with the constant second. |
|
BadSymbol |
%symbol% is not a valid symbol |
Check the symbol name for a typo, or confirm it exists for the selected chip. |
|
BadTableLocation |
Bad data table location, found %loc%, expected PROGRAM or DATA |
Use |
|
BadValueType |
Cannot store %value% in the %type% variable %var% |
Use a value compatible with the variable’s declared type, or cast it explicitly. |
|
BadVarAlias |
Variable defined with multiple aliases |
Remove the duplicate |
|
BadVarBit |
Variable %var% is of type %type% and does not have a bit %bit% |
Use a bit number valid for the variable’s type/size. |
|
BadVarName |
Invalid variable name: %var% |
Rename the variable - it must be a valid identifier and not a reserved word. |
|
BadVarType |
Invalid variable type: %type% |
Use one of GCBASIC’s supported variable types (Byte, Word, Long, Single, etc.). |
|
CannotConcat |
%type% %value% cannot be assigned/appended to a string variable |
Convert the value to a string first (e.g. with |
|
CannotHandleArrayConstruction |
Pointer mismatch: Cannot handle construct. Please check syntax, simplify source, check use of variable types, check String/Array size mismatch |
Simplify the expression, and double-check variable types and array/string sizes match. |
|
CannotHandleConstruction |
Pointer mismatch: Cannot handle variable construct… |
Simplify the expression, and double-check variable types and sizes match; note which target variable/sub the message names. |
|
CannotHandleFunctionCall |
A GCBASIC library method %fn% exists but the return variable does not. Is this a call to a Subroutine rather than a Function? |
Check whether %fn% is actually a Sub, not a Function, and call it accordingly. |
|
CannotUseReservedWords |
Reserved Words cannot be labels: %label% |
Rename the label to something that is not a GCBASIC command/keyword. |
|
CannotUseIncludeInsideInsert |
#INCLUDE not permitted within #INSERT, move to main program |
Move the |
|
ChipNotSupported |
No chip data file found for %chipname% |
Check the chip name for a typo, or confirm this compiler build supports that chip. |
|
ChipIgnored |
Additional #chip ignored. Using %prevchipname% as microcontroller |
Remove the extra |
|
ConstantExists |
Constant: %constname% equates to %existingconstant_value% and cannot be reassigned to equate to %value% |
Do not redefine an existing constant to a different value; use a different constant name, or |
|
ConstantReAssignemnt |
Constant: %constname% cannot be reassigned to %value% |
Use a different constant name, or |
|
ConstantValueReAssignement |
Constant: %constname% exists with no value '%existingconstant_value%', cannot be reassigned with %value% |
Give the constant its value at first definition rather than reassigning it later. |
|
DataFound |
READTABLE() cannot be to access EEPROM DATA %Table% |
Use the EEPROM-specific read routine instead of |
|
DoWithoutCondition |
Missing condition after %mode% |
Add a condition after |
|
DoWithoutLoop |
Do without matching Loop |
Add the matching |
|
DupDef |
Conflicting definition for %var% sub parameter variable. %var% is a %type%. Invalid source variable type |
Match the argument’s type to the parameter’s declared type, or rename one of the conflicting variables. |
|
DuplicateSub |
Duplicate subroutine name and parameters: %sub% |
Rename one of the two Subs, or change one’s parameter list so they are no longer identical overloads. |
|
ElseIfMissingThen |
Invalid syntax: Use ELSE IF <condition> THEN |
Add |
|
ElseIfNotSupported |
Invalid syntax: Use ELSE IF |
Use |
|
ElseWithoutIf |
Else outside of If … End If block |
Move the |
|
EndWithoutRepeat |
End Repeat without matching Repeat |
Add the matching |
|
EssentialFileMissing |
Essential file missing: %MissingFile% (listed in lowlevel.dat) |
One of the header files the compiler always loads (see Development Guide for GCBASIC.EXE compiler, Note #6) could not be found - this points to a broken or incomplete GCBASIC installation, not an error in your own program.
Reinstall or repair GCBASIC so the named file exists under |
|
ErrantElse |
Single line IF statement does not support ELSE |
Rewrite as a multi-line |
|
ExcessVars |
Excessive RAM usage! Delete some variables, reduce the size of arrays, or upgrade to a more powerful chip |
Free RAM by removing unused variables, shrinking arrays, or moving to a chip with more RAM. |
|
ExtraENDIF |
End If without If |
Remove the extra |
|
FirstPageFull |
First page of program memory is full, please reduce size of Main and Interrupt routines |
Move code out of Main/interrupt routines and into separate subroutines. |
|
FloatInDelay |
Found decimal point, but delays can only handle whole numbers |
Use a whole-number delay value. |
|
FollowOnElse |
Syntax Error: Follow on #ELSE not permitted |
Remove the extra |
|
ForBadEnd |
For end value is too big for the counter |
Use a loop counter variable large enough to hold the end value, or reduce the end value. |
|
ForBadStart |
For start value is too big for the counter |
Use a loop counter variable large enough to hold the start value, or reduce the start value. |
|
ForBadStart2 |
Invalid start value |
Check the For loop’s start value/expression for errors. |
|
ForBadStep |
For-Next 'step' must be integer when start or end values are variables |
Use an integer literal or Integer-typed variable for Step when Start/End are variables. |
|
ForBadStepNegate |
You cannot negate a step value. Negate the integer variable as a prior operation or pass a negative or positive value integer variable. |
Negate the Step value in a separate statement before the loop, then pass the already-negative variable. |
|
ForBadStepVariable |
For-Next 'step' must be Integer variable |
Use an Integer-typed variable for Step. |
|
ForStepNeeded |
For-Next 'step' integer variable must be specified when start or end values are variables - even for step 1 |
Add an explicit Step value/variable even if it’s just 1. |
|
InCorrectNumberofParameters |
Incorrect number of parameters |
Match the call’s argument count to the Sub/Function’s declaration. |
|
InCorrectTableFormatting |
Incorrect Table Text formatting at %var% |
Check quoting/comma placement in the Table source around %var%. |
|
InCorrectTableTextTermination |
Incorrectly Terminated Table Text Line |
Check that each Table text line is properly closed (matching quotes). |
|
IncorrectWaitParameter |
Incorrect time unit specified. This can be an indirect error from a subroutine - so, inspect all time based constants |
Check the Wait’s time unit, and any constants used for time values elsewhere in the program. |
|
InsertedFileMissing |
#INSERT file not found |
Check the |
|
InvalidBit |
Bit %bit% is not a valid bit and cannot be set |
Use a bit number that exists on the target register/variable. |
|
InvalidBitRead |
Bit %bit% is not a valid bit and cannot be read |
Use a bit number that exists on the target register/variable. |
|
InvalidConditionalStructure |
Invalid Conditional construct |
Check the condition’s syntax - operators, parentheses, and operands. |
|
InvalidDirCommand |
Invalid DIRection command. Command cannot contain ',' |
Set one pin/port’s direction per |
|
InvalidDoMode |
Invalid loop mode %mode%, mode (if specified) must be While or Until |
Use |
|
InvalidElse |
Invalid #ELSE - #IFDEF or #IFNDEF not preceded |
Make sure |
|
InvalidElseCantHandle |
Invalid #ELSE - cannot handle |
Simplify the surrounding |
|
InvalidNumericLiteral |
Invalid numeric literal %literal% - no digits follow the prefix |
A |
|
LoopWithoutDo |
Loop without matching Do |
Add the matching |
|
MissingCoreFile |
Cannot find file %core%, which is required for %chip% |
Reinstall/repair the GCBASIC installation so the missing core file is restored. |
|
MissingFunctionAssignment |
Missing Function Assignment - assign function result to a variable, or, change to a Subroutine |
Assign the function’s result (e.g. |
|
MissingOperand |
Missing operand, %pos% %operator% |
Add the missing value/variable on the indicated side of the operator. |
|
MissingSubParam |
Missing value for parameter %param% |
Supply a value for %param%, or give it a default value in the declaration. |
|
MissingTarget |
No subroutine specified as a target |
Name the subroutine to call/jump to. |
|
MissingEndSubDef |
Missing 'End Sub' or 'Return' definition or invalid 'GoSub' |
Add the matching |
|
MissingSubDef |
Missing Sub definition, or, missing GoSub definition, or, missing End Sub ( Return to exit/end a Sub Routine is no longer supported) |
Add the missing |
|
MissingEndFuncDef |
Missing End Function definition |
Add the matching |
|
MissingFuncDef |
Missing Function definition |
Add the matching |
|
MissingEndDataDef |
Missing End Data definition |
Add the matching |
|
MissingDataDef |
Missing Data definition |
Add the matching |
|
NextWithoutFor |
Next without matching For |
Add the matching |
|
NoBit |
Missing bit in Set command |
Specify the bit (e.g. |
|
NoChip |
Chip model not specified! GCBASIC cannot continue |
Add a |
|
NoClosingComma |
Missing closing comma delimiter in Table source |
Add the missing comma between Table source items. |
|
NoClosingQuote |
Missing closing double quote in Table source |
Add the missing closing |
|
NoDelayUnits |
Delay units not specified |
Add a time unit (e.g. |
|
NoDestParam |
Bad Destination parameter in ASM. The compiler has failed to optimise correctly. Try changing mathematical order with constants at end of order, or, post to support forum for advice/resolution. |
Reorder the calculation so constants come last, or ask on the support forum with the failing line. |
|
NoEndIf |
If without matching End If |
Add the matching |
|
NoEndRepeat |
Repeat without End Repeat |
Add the matching |
|
NoFile |
Cannot find %Filename% |
A file the program asked for could not be found, and compilation stops. Check the spelling of the |
|
NOFLOATPARAMETER |
No FLOAT parameter. For Singles support set to 1. See Help for details |
Set the float-capability preference/option to enable Single support, per the Help section it references. |
|
NoMatchingOverload |
No matching overload found for %subname% with these argument types |
None of the overloaded Sub/Function’s declared parameter lists fit the argument types given. See Subroutines for how single-character string literals and Byte/Bit parameters are matched. |
|
NoMatchingSig |
No subroutine found with matching parameters |
Check the argument types/count against the available overloads of that Sub/Function. |
|
NoNext |
For without Next |
Add the matching |
|
NoSelectVariableParameter |
No Select Case variable specified |
Give |
|
NoSourceParam |
Bad Source parameter in ASM. The compiler has failed to optimise correctly. Try adding element(s) to complete the array definition, or, changing mathematical order with constants at end of order, or, post to support forum for advice/resolution. |
Complete the array definition, reorder constants to the end of the calculation, or ask on the support forum with the failing line. |
|
NotABitORAConst |
%value% is not a bit or valid constant. Constant values should be 0 or 1 |
Use |
|
NotAVariable |
%value% is not a variable |
Use a declared variable here rather than a literal or undeclared name. |
|
NoThen |
If without Then |
Add |
|
NotIO |
%var%, or your Defined CONSTANT, is not a valid I/O pin or port |
Check the pin/port name (or the constant defined for it) against the chip’s actual I/O names. |
|
NotIONOTVALID |
is not a valid I/O pin or port |
Check the pin/port name against the chip’s actual I/O names. |
|
NotaValidDirective |
Not a valid directive %directive% |
Check the |
|
OperandTypeMismatch |
Operand %operand% cannot be used with %type% variables |
Use an operand compatible with the variable’s type, or convert the variable’s type first. |
|
OutOfProgMem |
Program is too large, cannot fit all subroutines into available program memory |
Reduce code size or move to a chip with more program memory. |
|
OutOfProgMemExceeded |
Program is too large, cannot fit into available program memory |
Reduce code size or move to a chip with more program memory. |
|
OutOfRegSpace |
Out of registers. Please break up any complex calculations |
Split the calculation into smaller steps using intermediate variables. |
|
PICASFailtoLaunch |
PIC-AS failed to execute: %var% |
Check the PIC-AS install path in Preferences/Tool Variables. |
|
ReadADMissingparentheses |
READAD |
READAD10 |
|
READAD12 function(s) required parentheses () as parameter delimiters |
Add parentheses around the argument, e.g. |
RecursiveDefine |
|
Recursive define |
Break the circular |
RepeatMissingCount |
|
No value given for Repeat |
Give |
ShouldNotUseConstant |
|
Select Case should not use a Constant |
Test a variable/expression in |
SubAndVarNameConflict |
|
Variable %var% cannot be created, a subroutine already has this name |
Rename the variable, or rename the conflicting subroutine. |
SubNotFound |
|
Subroutine %sub% could not be found |
Check the subroutine name for a typo, and confirm it (or its library) is included. |
SubParamNotVar |
|
%value% is not a variable and cannot be used for the parameter %param% |
Pass a declared variable for this parameter rather than a literal or expression. |
SubTooBig |
|
Subroutine %sub% is too large. Reduce its size, or switch to a more powerful chip |
Split the subroutine into smaller ones, or use a chip with more program memory. |
SymbolNotDefined |
|
Symbol [SFR]%symbol% has not been defined. Inspect ASM file to determine error |
Check the generated ASM file around this symbol to find what is missing. |
SynErr |
|
Syntax Error |
Re-check the line’s syntax against the command’s documentation. |
SynErrIncorrectBitDestination |
|
Syntax Error - cannot assign string to bit variable |
Assign a bit value (0/1/On/Off), not a string, to a bit variable. |
SynErrIncorrectByteDestination |
|
Syntax Error - cannot assign string to byte variable. Use ByteToString() |
Convert with |
SynErrIncorrectWordDestination |
|
Syntax Error - cannot assign string to word variable. Use WordToString() |
Convert with |
SynErrIncorrectLongDestination |
|
Syntax Error - cannot assign string to long variable. Use LongToString() |
Convert with |
SynErrIncorrectSingleDestination |
|
Syntax Error - cannot assign string to single variable. Use SingleToString() |
Convert with |
TableItemInvalid |
|
Item %item% cannot be stored in the table |
Check the item’s type/value against what the table’s declared type can hold. |
TableNotFound |
|
Lookup table %Table% not found |
Check the table name for a typo, and confirm it is declared before use. |
TooManyCaseValues |
|
Too many values in Case list (maximum %max%) |
Split the value list across more than one |
TooManyErrors |
|
Too many errors |
Fix the errors reported so far and recompile - the compiler stopped early because there were too many to usefully continue. |
UndeclaredArray |
|
Array %array% has not been declared |
Add a |
UndeclaredVar |
|
Variable %var% was not explicitly declared |
Add a |
UndeclaredMacroVar |
|
Macro variable %var% not declared - type unknown |
Give the macro variable an explicit type where it’s first used. |
UnhandledHexToSingleAssignement |
|
Unhandled hex value. Use byte component addressing for Hex value to Single variable assignment |
Assign to the Single variable’s individual byte components rather than the hex value directly. |
UsartBaudTooLow |
|
USART baud rate is too low |
Choose a higher baud rate achievable at the chip’s clock speed. |
UseSYSDEFAULTCONCATSTRING |
See Also:
- Conditions — the AND/OR and bit-comparison constraints in context
- Setting Variables — the calculation-complexity constraint in context
- Subroutines — the parameter-count and page-size constraints in context
- Functions — the parameter-count constraint in context
- DATA — the DATA block value-size constraint in context

