Syntax Errors

Syntax errors are errors that occur because the code you wrote does not comply with the required syntax. Figure 2.30 illustrates a syntax error that occurred because the As part of the Dim statement is missing.


T TestLoop


End S'jti

Siib TestLoop (J

■declare variable ta store Counter

Dim intCounter Integer

■increment intCounter £ro^ 1 to 5 ana ■ display outp; For intCounte Debug.Pri Next intCount

End S'jb

Siib TestError

Microsoft Visual Basic


Compile error: Expected end of statement



On Error GoTo HandleError = ^ *

Figure 2.30

0 0

Post a comment