Option Explicit Statement

프로그램 코드의 모든 변수를 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 This results in a run-time error
        Rem
    Next i%
End Sub

Please support us!