Hi. Using old-fashioned VB6, is it possible to loop through all the properties in a class I have created?
For example let's say I have a Class called clsTest that has 3 properties (strings) called Prop1, Prop2, and Prop3. In clsTest, I have a Let and Get for each of them (like in the code at the bottom here). I'd like to simply loop through the properties somehow, and display the value.
Assuming I Dim a class "MyClass" and load it with values
-- I'd like to print the values, something like this (very wrong) code:
For x = 1 to 3 'number of properties in the Class
Thanks for your suggestions.
Private msProp1 As String
Private msProp2 As String
Private msProp3 As String
Public Property Let Prop1(ByVal vData As String)
msProp1 = vData
Public Property Get Prop1() As String
Prop1 = msProp1
Public Property Let Prop2(ByVal vData As String)
msProp2 = vData
Public Property Get Prop2() As String
Prop2 = msProp2
Public Property Let Prop3(ByVal vData As String)
msProp3 = vData
Public Property Get Prop3() As String
Prop3 = msProp3