x3haloed
New member
- Joined
- Jan 8, 2009
- Messages
- 2
- Programming Experience
- 1-3
I have two classes, and I want one of them to be able to hold an array of the other.
Code:
Is this possible?
When I try to equate arrTerms() with another array, it throws this exception:
Code:
VB.NET:
Public Class CTerm
Public Text As String
Public Standard As Boolean
Public Overrides Function ToString() As String
Return Text
End Function
End Class
Public Class CTermMatch
Public arrTerms() As CTerm
Public Overrides Function ToString() As String
Dim strTemp As String
strTemp = ""
For Each pTerm In arrTerms
strTemp = strTemp & pTerm.ToString & " = "
Next
Return strTemp
End Function
End Class
When I try to equate arrTerms() with another array, it throws this exception:
VB.NET:
System.NullReferenceException was unhandled by user code
Message="Object reference not set to an instance of an object."