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