While learning OOP I stumbled into this problem.
Class clsCloth:
Main code:Code:Public Color As String
Public Manufactor As String
Public IsFirstTimeViewed As Boolean
Now even though I change the ClotheColor (Which is connected byRef to ChoosenClothe.Color) the ChoosenClothe.Color doesn't change to black (As seen in the debug.Print, try it.Code:Private Sub cmdClothe_Click(Index As Integer)
dim ChoosenClothe as New clsCloth
Call GetObjectDescription(ChoosenClothe.Color, ChoosenClothe.Manufactor, ChoosenClothe.IsFirstTimeViewed)
Debug.Print ChoosenClothe.ClotheColor
End Sub
Sub GetObjectDescription(ByRef ClotheColor As String, ClotheManufactor As String, ByRef Viewed As Boolean)
lblDescription.Caption = _
"Color: " & ClotheColor & vbNewLine & _
"Manufactor: " & ClotheManufactor & vbNewLine & _
"WasInfoSeen: " & Viewed
ClotheColor = "black"
End Sub
Now the question of the thread, why??
