title: Null Reference Exception was Unhandled
body: <p>This is a very simple code. I am just beginning to use vb. Im making a game where you try to solve a puzzle in the least amount of time and least amount of clicks. Every time I debug the program, it highlights the Clicks and FinalTime and says Null Reference Exception was Unhandled. I declared Clicks and FinalTime globally</p>
  
  <pre><code>Public Class Form1
  Dim Clicks As Integer = 0  'The variable that counts the number of times you clicked
  Dim Time As Integer 'The vairable that holds the time
  Dim TimeMin As Integer 'The variable that holds the minutes
  Dim TimeSec As Integer  'The variable that holds the seconds
  Dim FinalTime As String 'The variable that holds the final time (minutes and seconds)
  Dim NumArray() As Integer
  Dim NumArray1() As String
  
  Private Sub Times
  
      Time = Time + 1
      TimeSec = TimeSec + 1 
      TimeMin = Convert.ToInt32(TimeSec \ 60) 
      If Time &gt;= 60 Then
          Time = 0
      End If
      FinalTime = TimeMin &amp; " min " &amp; Time &amp; " seconds" 
      lblTime.Text = FinalTime 
  End Sub
  Private Sub Record(ByVal NumArray() As Integer, ByVal NumArray1() As String)
  
      For i As Integer = 0 To 1000 
          NumArray(i) = Clicks 'Problem is here
          i = +1
          Array.Sort(NumArray) 
      Next i
      lblRecordClicks.Text = NumArray(0) &amp; " Clicks" 
      For k As Integer = 0 To 1000 
          NumArray1(k) = FinalTime 'Problem is here
          k = +1
          Array.Sort(NumArray1) 
      Next k
      lblRecordTime.Text = NumArray1(0) 
  End Sub
  </code></pre>