Syntax
From Xojo Documentation
Any number of miscellaneous errors that were not identified by more specific error messages has occurred.
Sample Code
An omitted closing parenthesis:
An incorrect Dim statement:
Var f // omitting 'as' and data type
Var As Boolean // no variable name
Var Double As Double // 'Double' is a reserved word
Var a b As Integer // should be 'a,b'
Var c As // type missing
Var myFlag As True // illegal type and use of reserved word
The 'Then' keyword is missing from an If statement:
The ElseIf statement was not preceded by an If statement.
// do something
ElseIf j > 0 Then
// do something else
End If
// Correct
If j = 0 Then
.
ElseIf j > 0 Then
.
End If
The End If keyword is missing from an If statement:
An "#else" used instead of Else with a #If statement (conditional compilation).
#If TargetMacOS Then
b = Color.SelectedFromDialog(c, "Select a Color")
Else // should be #else
Beep
#EndIf
The Next keyword is missing from a For loop:
Var aInts(2, 2) As Integer
For i = 0 To 2
For j = 0 To 2
aInts(i, j) = i * j
Next
// final 'Next' missing here
One too many Next keywords are used in this example:
Var aInts(2, 2) As Integer
For i = 0 To 2
For j = 0 To 2
aInts(i , j) = i * j
Next
Next
Next //too many "nexts"
Omitting the Wend keyword from a While loop:
Omitting the While statement:
The Loop keyword is missing from a Do statement:
A Loop keyword was used without a preceding (matching) Do statement
The End Select keyword is missing from a Select Case statement:
Case 1
MessageBox("The party of the first part.")
Case 2
MessageBox("The party of the second part.")
// no matching End Select statement
The Select Case statement is missing:
Case 1 // Select Case statement missing
day = "Monday"
Case 2
day = "Tuesday"
End Select
The Sub and Function statements cannot appear inside a method.
A comma indicates that the second, required parameter is missing:
Using an equals sign when it is not necessary:
A keyword was misspelled:
A space rather than a comma is used to separate variable names in a Dim statement: