KirtSawaya
Technical User
Hello,
I'm a newbie to VB.NET and I'm having troubles loading an 2 dimensional array from a file. My code looks something like this:
Dim rows As Integer = 4
Dim columns As Integer = 5
Dim myArray(,) As Integer
Dim x As Integer = 0
Dim y As Integer = 0
For x = 0 To rows - 1
For y = 0 To columns - 1
Input(1, myArray(x,y))
Next
Next
But when I try to compile my code I get this error:
An unhandled exception of type 'System.NullReferenceException' occurred in Array.exe
Additional information: Object reference not set to an instance of an object.
If somebody could explain to me what I'm doing wrong I would really appreciate the help.
Thank you,
Kirt
I'm a newbie to VB.NET and I'm having troubles loading an 2 dimensional array from a file. My code looks something like this:
Dim rows As Integer = 4
Dim columns As Integer = 5
Dim myArray(,) As Integer
Dim x As Integer = 0
Dim y As Integer = 0
For x = 0 To rows - 1
For y = 0 To columns - 1
Input(1, myArray(x,y))
Next
Next
But when I try to compile my code I get this error:
An unhandled exception of type 'System.NullReferenceException' occurred in Array.exe
Additional information: Object reference not set to an instance of an object.
If somebody could explain to me what I'm doing wrong I would really appreciate the help.
Thank you,
Kirt