@Database "Error_Messages" @node "Error_Messages" @toc "Guide2Blitz:Guide2Blitz.guide/MAIN" Appendix 3 : Error Messages --------------------------- A3.1 You're bugging me ---------------------- The two major stumbling blocks for computer programmers are bugs and errors. These may be typing mistakes made when you typed the program into the computer, or errors of logic in your code. Before you can get the program to work correctly you have to find all of the bugs and correct them. When you are writing programs it often helps to remember that the computer can carry out three main activities: simple instructions, loops, and making decisions; these are the building blocks of all Blitz Basic programs. This guide has covered all of the instructions you need in Blitz Basic to tell the computer to carry out these activities. There are usually several different ways to write a program and some of them may be shorter and faster than others. When you are writing a long program is it a good idea to divide it up into lots of sections with sub-routines or procedures to carry out each activity. Breaking up programs into sections like this makes it much easier to find any mistakes. Usually it's a simple matter of correcting spellings and syntax. Blitz Basic does try to help by reporting errors as they occur, but wouldn't it be nice if we knew what these errors actually meant? A3.2 Blitz error messages ------------------------- The bold text is the actual message that is reported by Blitz Basic when an error occurs. Underneath is a brief description of the problem, and/or the possible solution. "Already Included" The same source code has been previously included in the code. "Array already Dim'd" A DIM statement is trying to dimension an array that has already been dimensioned. Arrays may not be re-dimensioned: Dim A$(10) ; Dim A$(10) "Array is not a List" A LIST function has been applied to an array that was not dimensioned as a List array. "Array not Dim'd" An undimensioned array has been unsuccessfully accessed. Check that the array names are correct. "Array not found" An array cannot be found in the main program. "Array not yet Dim'd" An undimensioned array has been unsuccessfully accessed. Check that the array names are correct. "Bad Data" The data following a DATA statement is of incorrect Type. Consult Chapter 1 for the correct Data Types. "Bad Type for For...Next" The FOR...NEXT index must be of numeric Type. "Can't Access Label" An undefined label has been unsuccessfully accessed. Check spelling of labels and GOTO/GOSUB branches. "Can't Assign Constant" Constant values cannot be assigned to variables. "Can't Assign Expression" The expression cannot be evaluated, or the evaluation has generated a value that is incompatible with the equate. "Can't Compare Types" The Type is incompatible with operations such as compares. "Can't Convert Types" The two Types are incompatible and one cannot be converted to the other. "Can't Create in Direct Mode" Variables cannot and must not be created in direct mode. "Can't create Macro inside Macro" Macro definitions cannot be created inside other macro definitions. "Can't Create Variable inside Dim" An undefined variable has been used as a dimension parameter with the DIM statement. "Can't Dim Globals in Procedures" Global variables cannot be defined within procedure definitions. "Can't Exchange different types" The EXCHANGE statement can only swap two variables of the same Type. "Can't Exchange NewTypes" The EXCHANGE statement cannot use NewTypes. "Can't Goto/Gosub a Procedure" Procedures cannot be branched to using GOTO/GOSUB. "Can't Load Resident" Blitz Basic cannot find the Resident file listed in the Options requester. Check the pathname. "Can't Nest Procedures" Procedures may not be defined within other procedure definitions. "Can't nest SetErr" Interrupt handlers cannot be nested. "Can't open Include" Blitz Basic cannot find the Include file; check the pathname. "Can't use comma in Let" The assigned variable is not a NewType or has only one entry. "Can't Use Constant" This is caused by clashing constant names. "Can't use Set/ClrInt in Local Mode" Error handling must occur in the primary code. "Case Without Select" A CASE statement has been found which does not have a corresponding SELECT statement. "CEND without CNIF/CSIF..." A CEND statement has been found which does not have a corresponding CNIF/CSIF statement. "Clash in Residents" Residents may not include the same Macro and Constant definitions. "CNIF/CSIF without CEND" A CNIF/CSIF statement has been found which does not have a corresponding CEND statement. "Constant already defined" Constants may only be defined once. "Constant not defined" An undefined constant has been used in an expression. "Constant Not Found" An undefined constant has been used in an expression. "Cont only Available in Direct Mode" CONT can only be called from Direct Mode. "Cont Option Disabled" The CONT option in the Options menu has been disabled. "Default without Select" A DEFAULT statement has been found which does not have a corresponding SELECT statement. "Direct Mode Buffer Overflow" Direct Mode has run out of memory. Try turning the "make smallest code" option off. "Duplicate For...Next Error" The same index has been used within two nested FOR...NEXT loops: For A=1 To 10 For A=1 To 10 Print " " Next A Next A "Duplicate Label" The same label has been used more than once within a program. "Duplicate Offset (Entry) Error" The NewType has two entries with the same name. "Duplicate parameter variable" Parameters listed in Blitz Basic keywords must be unique. "Duplicate Procedure name" Procedures must be unique in name. "Duplicated Type" Types must be unique in name. "Element isn't a pointer" The variable used is not a VAR Type and cannot point to another variable. "End NewType without NewType" An END NEWTYPE statement has been found which does not have a corresponding NEWTYPE statement. "End Select without Select" An END SELECT statement has been found which does not have a corresponding SELECT statement. "End SetErr without SetErr" An END SETERR statement has been found which does not have a corresponding SETERR statement. "End SetInt without SetInt" An END SETINT statement has been found which does not have a corresponding SETINT statement. "Error Reading File" AmigaDOS has generated an error whilst reading a file from disk. Some of the data may be corrupt or missing. "Expression too Complex" This should never occur. "For...Next Block too Long" A FOR...NEXT loop has exceeded the Blitz limit of 32K in size. Try removing or repositioning any non-essential code. "For Without Next" A FOR statement has been found which does not have a corresponding NEXT statement. Make sure the FOR index matches the NEXT index: ; *** This is wrong For A=1 To 10 Next B "Fractions Not allowed in Constants" Constants can only contain absolute values. "Garbage at End of Line" This usually happens when semi-colons are omitted from REMarks. "If Block too Large" An IF...ENDIF control structure has exceeded the Blitz limit of 32K in size. Remove any non-essential code from the structure. "If Without End If" An IF statement has been found which does not have a corresponding END IF statement. Both commands must be present: A=1 If A>0 Print "A is greater than zero" Mousewait End If "Illegal Absolute" The Absolute location specified must be defined and in range. "Illegal Array type" This should never occur. "Illegal Assembler Addressing Mode" The addressing mode is not available for the opcode. Check the Blitz Basic Reference Manual for more information. "Illegal Assembler Instruction Size" The instruction size is not available. Check the Blitz Basic Reference Manual for more information. "Illegal Constant" Constant values may not be assigned to variables. "Illegal Constant Expression" Constants can only consist of integers. "Illegal direct mode command" Direct Mode cannot execute this command. "Illegal Displacement" The Displacement location specified must be defined and in range. "Illegal Else in While Block" Check Chapter 4 in this guide for the correct use of the ELSE statement within a WHILE...WEND block. "Illegal End Procedure" The procedure return syntax is incorrect. Check the relevant syntax in Chapter 4. "Illegal Function Type" A function may not return a NewType. "Illegal Immediate Value" An Immediate value must be a constant and in range. Check the Blitz Basic Reference Manual for more information. "Illegal Interrupt Number" Amiga Interrupts may range from zero to 13 only. "Illegal Label Name" Consult Chapter 1 for the correct use of variables. "Illegal Local Name" The variable name is not valid. Consult Chapter 1 for acceptable variable names. "Illegal number of Dimensions" List arrays are limited to single dimensions. "Illegal Operator for Type" The operator for a Type is incorrect. "Illegal Parameter Type" NewTypes cannot be passed to procedures. "Illegal Procedure Call" The procedure call syntax is incorrect. Check the relevant syntax in Chapter 4. "Illegal Procedure return" The procedure return syntax is incorrect. Check the relevant syntax in Chapter 4. "Illegal TokeJsr token number" A library routine referred to by the TOKEJSR statement cannot be accessed. This is usually caused by the absence of a specific library from DefLibs. "Illegal Token" This should never occur. "Illegal Trap Vector" The 68000 microprocessor has only 16 trap vectors. "Illegal Type" An illegal Type has been used in a function or statement. "Illegally nested Interrupts" Interrupt handlers cannot be nested. "Label has been used as a Constant" A label and a constant have been named the same; labels and constants cannot share the same name. "Label not Found" An undefined label has been unsuccessfully accessed. Check for any spelling mistakes in label names. "Label reference out of context" This should never occur. "Library not Available in Direct Mode" The library is not available in direct mode. "Library not Found : 'library number'" A library routine referred to by a token cannot be accessed. This is usually caused by the absence of a specific library from DefLibs. "Macro already Defined" Macros must be unique in name. "Macro Buffer Overflow" Increase the size of the macro buffer in the Options requester. "Macro not Found" An undefined macro has been unsuccessfully accessed. "Macro too Big" Macros are limited to the buffer size defined in the Options requester. "Macro without End Macro" A MACRO statement has been found which does not have a corresponding END MACRO statement. "Macros Nested too Deep" This should never occur. "Mismatched Types" This usually happens when string variables are given numeric values or vice versa. It can also arise when you try to EXCHANGE the values of string variables with numeric values. "Next without For" A NEXT statement has been found which does not have a corresponding FOR statement. Both commands must be present. "No Terminating Quote" All text strings should be enclosed in quote marks (e.g. "STRING"). "Not Enough Parameters" A command has been given too few parameters. Check the relevant command syntax in this guide. "Not Supported" This should never occur. "Numeric Over Flow" The signed value is too large to fit in the provided variable space. "Offset not Found" The offset has not been defined in the NewType definition. "Only Available in Amiga mode" A command is only available in Amiga mode. Refer to the relevant command in this guide for correct mode details. If in doubt, try adding QAMIGA before the command: ; *** Go into a quick Amiga mode QAMIGA ; *** Execute command WaitEvent ; *** Return to Blitz mode BLITZ "Only Available in Blitz mode" A command is only available in Blitz mode. Refer to the relevant command in this guide for correct mode details. "Optimizer Error! - $'" This should never occur. "Precedence Stack Overflow" This should never occur. "Previous Case Block too Large" The CASE section in a SELECT...END SELECT block has exceeded the Blitz limit of 32K in size. Try removing or repositioning any non-essential code. "Procedure not found" An undefined procedure has been called. Check for spelling mistakes and typing errors. "Repeat Block too large" REPEAT...UNTIL/FOREVER blocks are limited to 32K in length. "Repeat without Until" A REPEAT statement has been found which does not have a corresponding UNTIL statement. "Select without End Select" A SELECT statement has been found which does not have a corresponding END SELECT statement. "SetErr not allowed in Procedures" Error handling cannot be accessed in a procedure definition. "SetInt without End SetInt" A SETINT statement has been found which does not have a corresponding END SETINT statement. "Shared outside of Procedure" The SHARED statement must be contained within a procedure definition. "Syntax Error" There is a syntax error in the program. Either a command is not a Blitz reserved keyword or has an incorrect parameter - refer to the relevant syntax in this guide. This is an extremely common problem. "Token Not Found : 'token number'" An unknown token has been found. Check the spelling of all Blitz reserved keywords. "Too many comma's in Let" A NewType has fewer entries than the number of values in LET. "Too many parameters" A command has been given too many parameters. Check the relevant command syntax in this guide. "Type Mismatch" This usually happens when string variables are given numeric values or vice versa. It can also arise when you try to EXCHANGE the values of string variables with numeric values. "Type Not Found" An undefined Type has been unsuccessfully accessed. "Type too Big" The unsigned value is too large to fit in the variable space provided. "Unterminated Procedure" A procedure has been created but its definition has not been terminated. The relevant END FUNCTION or END STATEMENT commands must be present. "Until without Repeat" An UNTIL statement has been found which does not have a corresponding REPEAT statement. A REPEAT...UNTIL loop requires both statements to be present, otherwise an error is generated. "Variable already Shared" Variables can only be SHARED once. @endnode