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.

(General)

T TestLoop

"3

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

th

Compile error: Expected end of statement

OK

Help

On Error GoTo HandleError = ^ *

Figure 2.30

0 0

Post a comment