Option Explicit Statement

Ghi rõ rằng mọi biến trong mã chương trình đều phải được khai báo dứt khoát dùng câu lệnh Dim.

Syntax:

Option Explicit

Parameters:

warning

This statement must be added before the executable program code in a module.


Example:


Option Explicit
Sub ExampleExplicit
Dim sVar As String
    sVar = "Las Vegas"
    For i% = 1 to 10 REM Gây ra một lỗi lúc chạy
        Rem
    Next i%
End Sub

Please support us!