hello intelligent people,
Simple problem.....
I have a class (compiled it to make dll).
It has one property (nm) and one method (rtn).
I am setting this property as "abhay" in my code, which will get converted to "ABHAY". (simple Ucase function).
Now, i want to display a messagebox saying "Got abhay" if
value of nm is "ABHAY".
Problem is, method rtn in class is not getting value of property nm.
Little jumbling? c the code below.
CLASS CODE
Public Property Get nm() As String
nm = myname
End Property
Public Property Let nm(ip As String)
myname = UCase(ip)
End Property
Public Sub rtn()
If ip = "abhay" Then
MsgBox "got it"
End If
End Sub
Follows is a code, where i set property of nm.
CODE
Private Sub Command1_Click()
Dim ab As New nmclass
ab.nm = "abhay"
ab.rtn
End Sub




Reply With Quote