D
deltaquattro
Hi,
I would like to add a collection in my class: naturally I would like
to keep all the automagic methods of the Collection object (Add,
Count, etc.). For now I did it like this:
'Class Module
Public ErrorString As Collection
'Class Initialization Method
Private Sub Class_Initialize()
Set ErrorString = New Collection
End Sub
but I know that using Public properties is Not A Good Thing. How could
I do this with a Private collection? Can you show me how to rewrite
the Add, Count, etc. methods? I tried to do that myself but it didn't
work. For example, if I write
Public Function Add(Error As String)
ErrorString.Add String
End Sub
I cannot see .ErrorString.Add among the properties of my class! What
am I doing wrong? Thanks,
Best Regards
deltaquattro
I would like to add a collection in my class: naturally I would like
to keep all the automagic methods of the Collection object (Add,
Count, etc.). For now I did it like this:
'Class Module
Public ErrorString As Collection
'Class Initialization Method
Private Sub Class_Initialize()
Set ErrorString = New Collection
End Sub
but I know that using Public properties is Not A Good Thing. How could
I do this with a Private collection? Can you show me how to rewrite
the Add, Count, etc. methods? I tried to do that myself but it didn't
work. For example, if I write
Public Function Add(Error As String)
ErrorString.Add String
End Sub
I cannot see .ErrorString.Add among the properties of my class! What
am I doing wrong? Thanks,
Best Regards
deltaquattro