Just Some Bread
Just Some Bread
CC#
Created by Just Some Bread on 11/29/2023 in #help
Object reference set to an instance of an object.
So it counted up more items
48 replies
CC#
Created by Just Some Bread on 11/29/2023 in #help
Object reference set to an instance of an object.
I think its because studentInfo was a 2d array and .length usually works only for 1D arrays
48 replies
CC#
Created by Just Some Bread on 11/29/2023 in #help
Object reference set to an instance of an object.
That fixed it
48 replies
CC#
Created by Just Some Bread on 11/29/2023 in #help
Object reference set to an instance of an object.
i changed it to i<studentInfo.GetLength(0)-1
48 replies
CC#
Created by Just Some Bread on 11/29/2023 in #help
Object reference set to an instance of an object.
Yeah it seems to be running for a 6th time so i = 6, even though it should stop at 5
48 replies
CC#
Created by Just Some Bread on 11/29/2023 in #help
Object reference set to an instance of an object.
Still seem to be getting the error.
48 replies
CC#
Created by Just Some Bread on 11/29/2023 in #help
Object reference set to an instance of an object.
Should be 5.
48 replies
CC#
Created by Just Some Bread on 11/29/2023 in #help
Object reference set to an instance of an object.
That might explain why its giving me an exception when i = 5;
48 replies
CC#
Created by Just Some Bread on 11/29/2023 in #help
Object reference set to an instance of an object.
string[,] studentInfo = new string[splitData.Length-1, 3];
string[,] studentInfo = new string[splitData.Length-1, 3];
48 replies
CC#
Created by Just Some Bread on 11/29/2023 in #help
Object reference set to an instance of an object.
Except now its coming out as an IndexOutOfRangeException
48 replies
CC#
Created by Just Some Bread on 11/29/2023 in #help
Object reference set to an instance of an object.
Since i didnt initialise every row
48 replies
CC#
Created by Just Some Bread on 11/29/2023 in #help
Object reference set to an instance of an object.
Yeah that explains why it would set it to null.
48 replies
CC#
Created by Just Some Bread on 11/29/2023 in #help
Object reference set to an instance of an object.
Seems to work now!
48 replies
CC#
Created by Just Some Bread on 11/29/2023 in #help
Object reference set to an instance of an object.
I initialised a 2D array as string[][] not string[ , ]
48 replies
CC#
Created by Just Some Bread on 11/29/2023 in #help
Object reference set to an instance of an object.
Aha I found the issue
48 replies
CC#
Created by Just Some Bread on 11/29/2023 in #help
Object reference set to an instance of an object.
When you initialise a string array does it set the items to null or empty strings?
48 replies
CC#
Created by Just Some Bread on 11/29/2023 in #help
Object reference set to an instance of an object.
That sounds like that could be the issue the variable watch is saying that its currently null.
48 replies
CC#
Created by Just Some Bread on 11/29/2023 in #help
Object reference set to an instance of an object.
Its on line 45
48 replies
CC#
Created by Just Some Bread on 11/29/2023 in #help
Object reference set to an instance of an object.
This is the line which says theres an issue
48 replies
CC#
Created by Just Some Bread on 11/29/2023 in #help
Object reference set to an instance of an object.
studentInfo[i][2] = Convert.ToString(total);
studentInfo[i][2] = Convert.ToString(total);
48 replies