NXProf
Mechanical
- Nov 28, 2012
- 45
Hello,
Has anyone received the System.NullReferenceException: Object reference not set to an instance of an object at NXJournal.Main() error message when attempting to perform an array operation?
I've declared a counter and an array number variable with the following:
Dim yCoordIndexCounter As Integer = 0
Dim sortedArrayOfYCoords() As Double
Then later in the code, I've used the counter within the array and set it equal to the y-coordinate in order to sort the y-coordinates later. But instead, arrayOfYCoords(yCoordIndexCounter) = origin1.Y is the line where I receive the above System.NullReferenceException error message.
I've research some of the reasons for my code generating this error message. And all I can figure out is that the array number variable is initially an empty set. Subsequently, how can you add to it or populate it if this message prevents numbers being added?
Thank you for your help ahead of time.
Has anyone received the System.NullReferenceException: Object reference not set to an instance of an object at NXJournal.Main() error message when attempting to perform an array operation?
I've declared a counter and an array number variable with the following:
Dim yCoordIndexCounter As Integer = 0
Dim sortedArrayOfYCoords() As Double
Then later in the code, I've used the counter within the array and set it equal to the y-coordinate in order to sort the y-coordinates later. But instead, arrayOfYCoords(yCoordIndexCounter) = origin1.Y is the line where I receive the above System.NullReferenceException error message.
I've research some of the reasons for my code generating this error message. And all I can figure out is that the array number variable is initially an empty set. Subsequently, how can you add to it or populate it if this message prevents numbers being added?
Thank you for your help ahead of time.