User defined classes

S

Scott

I have defined several classes in my form script and I
want to use them to hold information during the processing
of the form. The initialization of the form is good but I
can't seem to assign data to the class properties.

Class MyClass
private someProp
private CID
Public Property Let ThisProp(byval NewVal)
someProp=NewVal
End Property

Public Property Get ThisProp()
ThisProp=someProp
End Property

Private Sub Class_Initialize()
CID="MyClass" & Timer
End Sub

Property Get ClassID()
ClassID=CID
End Property
End Class

..
Dim aClass
Set aClass=New MyClass

MsgBox "The class ID = " & aClass.ClassID

aClass.ThisProp="SomeStuff"

MsgBox "The Stuff =" aClass.ThisProp

The first Msgbox displays the ID just fine. The second
shows an empty varaiable.

Is there something wrong here?


Thanks for your help.

Scott
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top