Set Class properties

A

Aidy

I'd like to set the properties outside of a class module. This is the
code in the class module

<snip>
Public Sub HostExample()

Set m_ttHost = teemtalk.CurrentSession.Host

m_ttHost.Send User

End Sub


Public Property Let User(sUser As String)
User = sUser
End Property
<snip>

But when I compile, I am told that this is an invalid use of
a property. What am I doing wrong?

Thanks

Aidy
 
P

Peter Hewett

Hi Adrian

Looks like you've got a naming conflict. Your property is call "User" but so
is the classes proivate variable! Try this:

Private mstrUser As String

Public Property Let User(ByVal strUser As String)
mstrUser = strUser
End Property

HTH + Cheers - Peter


(e-mail address removed) (Aidy) wrote in
 

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