Message 1 of 5
how to call a member variable in a class

Not applicable
06-11-2003
08:31 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
given a class clsWeldSym
with a member var
Private mWeldInsPt As Variant
Property Let inspt(val As Variant)
mWeldInsPt = val
End Property
Property Get inspt() As Variant
inspt = mWeldInsPt
End Property
and a Draw method
Public Sub Draw()
I'm probably going about this in the wrong way, but here's what I'm trying
in the calling sub:
dim ws as clsWeldSym
Set ws = New clsWeldSym
after setting anumber of variables the calling sub goes
ws.draw
in the clsWeldSym class module the draw method starts out...
Public Sub Draw()
'check for existence of weld sym
'here I want to get a point, and set to the member variable mWeldSymInsPt
using the InsPt property of the clsWeldSym object
ws.inspt = doc.Utility.GetPoint(, "Pick point for weld sym")
but the ws was declared in the calling function, not in the class mod
itself, so I guess I should be getting the point outside of the method eh,
before calling ws.draw?
then in ws.draw for the insertion point would I just use the member variable
itself, or call the get property?
inside a method in a class, how do I refer to class properties? or do I just
use the member variables themselves directly.
with a member var
Private mWeldInsPt As Variant
Property Let inspt(val As Variant)
mWeldInsPt = val
End Property
Property Get inspt() As Variant
inspt = mWeldInsPt
End Property
and a Draw method
Public Sub Draw()
I'm probably going about this in the wrong way, but here's what I'm trying
in the calling sub:
dim ws as clsWeldSym
Set ws = New clsWeldSym
after setting anumber of variables the calling sub goes
ws.draw
in the clsWeldSym class module the draw method starts out...
Public Sub Draw()
'check for existence of weld sym
'here I want to get a point, and set to the member variable mWeldSymInsPt
using the InsPt property of the clsWeldSym object
ws.inspt = doc.Utility.GetPoint(, "Pick point for weld sym")
but the ws was declared in the calling function, not in the class mod
itself, so I guess I should be getting the point outside of the method eh,
before calling ws.draw?
then in ws.draw for the insertion point would I just use the member variable
itself, or call the get property?
inside a method in a class, how do I refer to class properties? or do I just
use the member variables themselves directly.