クラスの変数

クラスには、dimタイプ、privateタイプまたはpublicタイプの変数を含めることができます。

クラスのGetプロパティを使用することでのみ、クラス外部でこれらの変数にアクセスできます。

変数のタイプを明示的に指定する必要があります。

例:

Class Main_Class
        Private var1
        Private Sub Class_Initialize            
            var1 = "BSL"
        End Sub

        Public Property Get Var                 
            Var = var1
        End Property
End Class

' Instantiation of the Class and accessing the variable using Get property
Set oMain = new Main_Class
oMain.Var