190
14.6 Compile error messages
There are many causes for compiler errors. As the compiler detects errors it displays a warning message in the lower text
box of the Workspace Editor. Macros with errors cannot be downloaded and are listed in the Not Download Macro box of the
Macro Dialog.
Error message format: Macro_name(: Error_Number ) Error_Message
The Error_ Number corresponds to one of the conditions listed below.
Error_Number descriptions
Number
Message Format
Sample Code
Reason for error
1
"Syntax error:" 'identifier'
Macro_Command main( )
Char i , 3xyz
int g[4]
g[3] = 4
End Macro_Command
An unsupported variable name ,”Error
message: “Syntax error: 3x”
Variable names must begin with
alphabet characters.
2
'identifier' used without
having been initialized
Macro_Command main( )
Char i
int g[i]
g[3] = 4
End Macro_Command
Undefined size of an array. Arrays must
be defined with fixed values.
3
"Re-declaration error: "
'identifier'
Macro_Command main( )
int g[10] , g
For g = 0 To 2
g[3] = 4
Next g
End Macro_Command
“g” is defined twice in the same
function. The name of variable or
function cannot be used more than
once in a function.
4
"Function name error:"
'identifier'
Macro_Command If( )
. . .
End Macro_Command
“If” is being used as the Function name.
Reserved keywords or constants cannot
be the name of a function
5
"Statement missing"
Macro_Command main )
Function definition missing “(“
6
"Missing expression in If statement"
7
"Missing “Then” in If statement"
8
"Missing “EndIf” "
9
"Unfinished “If’ statement before “End If” "
10
"Illegal Else statement"
The format for “If-Then” statement is:
If [logic expression]Then
[ Else [If [logic expression] Then ] ]
EndIf
Formats other than this cause compile errors.
11
"There should be constant behind “Case” "
12
"Missing “Case” behind “Select” "
13
"Missing “expression” behind “Select Case” "
14
"Missing “End Select” statement"
15
"Illegal “Case” statement"
16
"Unfinished “Select” statement before “End Select” "
The format for “Select-Case” statement is:
Select Case [expression]
Case [constant]
Case [constant]
Case [constant]
Case Else
End Select
Formats other than this cause compile errors.
17
" “For” statement error: missing “For” before “Next” "
18
"Should be integer of char variable"
19
"Missing assign statement"
20
"Missing keyword “To” "
21
"Missing “Next” statement"
The format for “For-Next” statement is:
For [variable] = [initial value] To [end value] [Step]
Next [variable]
Formats other than this cause compile errors.
22
" “While” statement error: missing “While” before
“Wend” "
23
"Missing “Wend” statement"
The format of “While” statement is:
While [logic expression]
Wend
Formats other than this cause compile errors.
Summary of Contents for MMI-1500
Page 2: ...ii...