У меня есть класс со следующими свойствами:
Dim pBonds() as string
Private Property Get Bonds() As String
Bonds = pBonds
End Property
Private Property Get Bond(index As Long) As String
Bond = pBonds(index)
End Property
Private Property Let Bond(index As Long, strValue As String)
If index > UBound(pBonds) Then ReDim Preserve pBonds(index)
pBond(index) = strValue
End Property
когда я пытаюсь:
Set o = New CBondBasket
For k = LBound(arr) To UBound(arr)
o.Bond(k) = arr(k)
Next k
Я получаю ошибку Method or data member not found
Есть идеи, откуда это взялось?
внес изменения
пометил их как общедоступные и добавил инициализацию и byval (получил еще одну ошибку без него)
Private Sub Class_Initialize()
ReDim pBonds(0)
End Sub
Public Property Get Bonds() As String()
Bonds = pBonds
End Property
Public Property Get Bond(index As Long) As String
Bond = pBonds(index)
End Property
Public Property Let Bond(ByVal index As Long, ByVal strValue As String)
If index > UBound(pBonds) Then ReDim Preserve pBonds(index)
pBonds(index) = strValue
End Property
ошибка: Определения процедур свойств для одного и того же свойства противоречивы, или процедура свойств имеет необязательный параметр, ParamArray или недопустимый заданный конечный параметр, может кто-нибудь мне помочь с этим? спасибо