投稿日 | : 2003/05/21(Wed) 18:49 |
投稿者 | : イトウ |
Eメール | : |
URL | : |
タイトル | : Re^3: Property Let & Getと普通の変数の違いについて |
あとは、こんなんも
'***** Class1 *****
Dim x(0 To 256) As Byte
Public Property Get Property1(ByVal iIndex As Long) As Long
Property1 = x(iIndex)
End Property
Public Property Let Property1(ByVal iIndex As Long, ByVal NewValue As Long)
x(iIndex) = Abs(NewValue Mod 256)
End Property
'******************
'***** Module1 *****
Public Sub Main()
Dim p As New Class1
p.Property1(10) = 150
Debug.Print p.Property1(10)
End Sub
'*******************