I'm trying to use a string array as a property. I can read the LBound/UBound so it seems the array is loading properly during the 'Let', and the 'Get' is working for the boundary functions, but I can't seem to access the values. Any ideas?
Code:
Set oMyClass = New cArrayTest
With oMyClass
.Files_List = "File 1"
.Files_List = "File 2"
.Files_List = "File 3"
MsgBox "LBound: " & LBound(.Files_List) & vbcrlf & "UBound: " & UBound(.Files_List)
MsgBox .Files_List(0)
End With
WScript.Quit
Class cArrayTest
Private mFiles_List() 'as String [Array]
Private mFiles_List_Counter 'as Integer
Private Sub Class_Initialize()
ReDim mFiles_List(0)
End Sub
Public Property Let Files_List(ByVal vData)
mFiles_List_Counter = mFiles_List_Counter + 1
ReDim Preserve mFiles_List(mFiles_List_Counter)
mFiles_List(mFiles_List_Counter) = vData
End Property
Public Property Get Files_List()
Files_List = mFiles_List
End Property
End Class