Compile Errors

Top  Previous  Next

Compile errors occur when a program is being compiled and they indicate syntax errors in the source code. If the compiler detects an error it displays it in the Message Panel and continues compiling until the error limit is reached. The error limit can be set in the Configuration Dialog.

 

For example, if you try to compile:

 

        X:= 2 + 3.5;

 

The compiler will display the following error in the Message Panel:

 

Error: Main(Ln:5) Mixed Mode

 

Compile error messages can sometimes be misleading because the actual error might have occurred prior to the point that the compiler flags as the error. The reason these two points do not always coincide is because the compiler finds the code at the actual error to be syntactically correct, but it interprets it in a way other than what was intended. This alternate interpretation can go for several lines before an error is finally flagged. An extreme example of this is failing to terminate a string with a close quote. In this case the compiler simply interprets the following code as being part of the string, and an error is not detected until either a quote mark or the end-of-file is encountered. Particularly misleading error messages can result from unpaired begin-ends.

 

Error Messages. All of the compile error messages are listed below together with some helpful comments and suggestions.

 

1: Too Many Variables. Procedures with too many variables should be broken into smaller procedures. Perhaps the variables are more global than necessary. Perhaps several variables could be combined into an array.

 

2: Too Many Real Constant Names. There are too many constants "define"d as real values in scope at one time. The maximum number is 160. Perhaps they are more global than necessary.

 

3: Too Many Names. There are too many names (variables, procedures, intrinsics, constants, etc.) in scope at one time causing the symbol table to overflow. The maximum number is 1600. Perhaps some intrinsics are declared but not used. Perhaps some names are more global than necessary. Perhaps several variables could be combined into an array.

 

4: Too Many 'Quits'. There cannot be more than 160 total "quit" statements inside a "loop". This total includes "quit"s for other "loop"s that are nested inside the "loop".

 

5: Too Many Static Levels. Procedures can be nested to a maximum depth of eight levels.

 

6: Number Out Of Range. Integers are limited to the range of -32768 through +32767.

 

7: Number Out Of Range. Intrinsic "code" declarations are limited to 0 through 127.

 

10: Undeclared Name. The name is undefined here. It might be out of scope or be forward referenced. A procedure declaration that is missing a semicolon causes the rest of the line to not be seen (it is taken as a comment).

 

11: Name Already Declared. This name conflicts with a previous declaration at this level. Only the first 16 characters are significant to the compiler.

 

20: Illegal Start Of A Statement. Missing an "end"? Unpaired "begin-end"s? If "procedure" is flagged then there is a missing "end" in the previous procedure.

 

21: ":=" Expected But Not Found. Illegal variable in a "for" or an assignment statement? The control variable in a "for" loop cannot have a subscript.

 

22: 'Then' Expected But Not Found. Illegal expression in an "if" statement?

 

23: 'Do' Expected But Not Found. Illegal expression in a "for" or "while" statement?

 

24: ",", "to" or "downto" Expected But Not Found. Illegal expression in a "for" statement?

 

26: Illegal Factor. Incomplete expression or an illegal operator? Semicolon or "of" before an "other" in a "case" statement? Perhaps parentheses are needed around an "if" expression.

 

27: Statement Starting With A Constant. The name is declared as a constant, which cannot be assigned a value.

 

28: 'Until' Expected But Not Found. Perhaps the previous statement is missing a semicolon. Unpaired "begin" "end"s within a "repeat" block?

 

29: 'Other' Expected But Not Found. A "case" statement must be terminated with an "other" statement. Perhaps the previous statement is missing a semicolon.

 

30: 'Else' Expected But Not Found. An "if" expression must have the "else" clause. Illegal expression after the "then"? Do not confuse an "if" expression for the more common "if" statement.

 

31: Digit Expected But Not Found. Either the exponent of a real number or a hex digit is missing.

 

33: Integer Variable Expected But Not Found. The control variable in a "for" statement must be an integer or character variable.

 

38. '">" Expected But Not Found. The greater-than symbol for the Arithmetic Shift Right (>>) operator not found.

 

39: "(" Expected But Not Found. Parentheses must enclose arguments.

 

40: "=" Expected But Not Found. In a "code" declaration every name must be set equal to an integer.

 

41: ";" Expected But Not Found. A semicolon must be at the end of a declaration, must separate procedures, and must separate statements within a "begin-end" (or a "repeat-until") block.

 

42: Constant Expected But Not Found. In a "define" or a constant array the values must be previously declared constants or be integer or real constants; they cannot be variables.

 

43: Variable Expected But Not Found. The "address" operator can only return the address of a variable.

 

44: ")" Expected But Not Found. Parentheses must be balanced. Even though balanced, extra sets of parentheses around arguments and subscripts are illegal.

 

45: Name Expected But Not Found. There must be a name in a declaration.

 

46: Mixed Mode. Reals and integers cannot be mixed within an expression without explicitly doing the type conversions using the intrinsics Fix and Float. This message can be triggered if a variable is undefined. Also, a forward-function declaration and its function must be the same data type.

 

47: Integer Expected But Not Found. The indicated value or expression is not of type integer. Subscripts, the control variable in a "for" loop, and "case" expressions cannot be reals.

 

48: 'Of' Expected But Not Found. Illegal expression in a "case" statement?

 

49: ":" Expected But Not Found. Illegal expression in a "case" statement?

 

50: "]" Expected But Not Found. Constant-array brackets must be balanced. Perhaps a comma is missing.

 

51: No Arguments Declared. The called procedure has no local variables declared and therefore cannot have arguments passed to it.

 

52: Statement Starting With 'Else'. An "else" is never preceded by a semicolon.

 

53: Statement Starting With 'Other'. An "other" is never preceded by a semicolon.

 

60: 'Quit' Not In A 'Loop'. The "quit" statement is legal only inside a "loop" block.

 

61: EOF Expected But Not Found. More code after the apparent end of the program. Unpaired "begin" "end"s? Too many "end"s or missing a "begin"?

 

62: EOF Inside A Block. End-of file (CTRL-Z, $1A) is inside a block statement. Too many "begin"s or not enough "end"s? Incomplete or missing statement?

 

63: EOF Inside A String. Unpaired double quote (")? A caret (^) can cause a quote to not be seen.

 

65: 'FProc' & Its 'Proc' Not At Same Level. A forward procedure declaration and its corresponding procedure declaration must be at the same level and must be in scope with each other.

 

66: 'FProc' Reference Not Found. Unresolved forward procedure or function reference. Perhaps it is out of scope. "fproc" and its corresponding "proc" must be at the same static level. Maybe a "begin" is missing.

 

67: 'Proc' Or 'Func' Expected But Not Found. "public" must be followed by "procedure" or "function".

 

68: 'EProc's And 'Public's Must Be Global. "eproc"s, "efunc"s, and "public"s must be at level zero; they cannot be inside a procedure (except the main routine).

 

69: 'Include's Nested Too Deep. A file that is included can itself include other files. These files also can include files, but the chain of includes is limited to eight levels. Perhaps a file is including itself, or is including a file that includes the original file.

 

70: Bad File Spec. The specification should be: C:\path\filename.ext; Everything but the file name is optional. The semicolon is required. Backslashes do not designate comments in a file name.

 

71: File Not Found. Perhaps the file is not in the current directory.

 

72: 'Int', 'Real', 'Char', or 'Addr' Expected But Not Found. The variable type for a segment variable was not found.

 

73: Divide By Zero In A Constant Expression. The factors in a constant expression caused a divide-by-zero error during compilation.

 

74: Math Error In A Constant Expression. Floating point overflow or underflow occurred inside a constant expression

 

75: Expression Must Be Enclosed In Parentheses. Exclusive-or operations (|) and "if" expressions must be enclosed in parentheses when the short-circuit boolean command-line switch (/b) is used.

 

75. Too Many Intrinsic Arguments. The number of arguments passed to an intrinsic are more than were specified in the intrinsic prototype.

 

76. Too Few Intrinsic Arguments. The number of arguments passed to an intrinsic are less than were specified in the intrinsic prototype.

 

77. Argument Type Mismatch. The arguments passed to an intrinsic don't match the types that were specified in the intrinsic prototype.