Hello, bit of a newb question sorry. I am having trouble figuring out what I am doing wrong when trying use arrays with classes.
For my class declaration I have
This is all under a class filetype
I have declared the following at the start of frmMain
Then I (try) to add values. This is the part that gives me an error message "Object reference not set to an instance of an object."
I figure it is some simple error on my part but I'm drawing a blank. Any help would be greatly appreciated.
Cheers.
For my class declaration I have
VB.NET:
Public Class ClassWord
Public NativeWord As String
Public ForiegnWord As String
Public ... (cropped the rest)
End Class
This is all under a class filetype
I have declared the following at the start of frmMain
VB.NET:
Public Word() As ClassWord
Then I (try) to add values. This is the part that gives me an error message "Object reference not set to an instance of an object."
VB.NET:
Word(0).NativeWord = "Boy"
Word(0).ForiegnWord = "Pojke"
Word(1).NativeWord = "Girl"
Word(1).ForiegnWord = "Flicka"
I figure it is some simple error on my part but I'm drawing a blank. Any help would be greatly appreciated.
Cheers.