Hi, I've got an 'Object reference not set to an instance of an object.' error in a very basic routine, but for the life of me I can't get my head around solving it.
I have defined structures:
Structure GameData
Public Name As String
Public Description As String
Public rom As List(Of strRom)
End Structure
Structure strRom
Public name As String
Public size As String
Public crc As String
Public md5 As String
Public sha1 As String
End Structure
now all I'm trying to do is to define an instance of these and fill it, for sake of simplicity I've refined the code below to give the error in the most obvious way.
Dim gdata As New GameData
Dim romdata As New strRom
gdata.Name = "Game Name"
gdata.Description = "Game Description"
romdata.crc = "rom crc"
romdata.md5 = "rom md5"
romdata.name = "rom name"
romdata.sha1 = "rom Sha1"
romdata.size = "rom size"
gdata.rom.Add(romdata)
I get the error on the last line above. I know this must be an obvious thing i'm missing but I'm stumped any help would be appreciated.
Thanks
I have defined structures:
Structure GameData
Public Name As String
Public Description As String
Public rom As List(Of strRom)
End Structure
Structure strRom
Public name As String
Public size As String
Public crc As String
Public md5 As String
Public sha1 As String
End Structure
now all I'm trying to do is to define an instance of these and fill it, for sake of simplicity I've refined the code below to give the error in the most obvious way.
Dim gdata As New GameData
Dim romdata As New strRom
gdata.Name = "Game Name"
gdata.Description = "Game Description"
romdata.crc = "rom crc"
romdata.md5 = "rom md5"
romdata.name = "rom name"
romdata.sha1 = "rom Sha1"
romdata.size = "rom size"
gdata.rom.Add(romdata)
I get the error on the last line above. I know this must be an obvious thing i'm missing but I'm stumped any help would be appreciated.
Thanks