title: Function Calling Itself, Can't Dodge StackOverflow Error
body: <p>I understand that this is bad programming practice and redundant coding but I am curios.</p>
  
  <p>I am simply counting a number up to 9999999 in a while loop. The <code>Add()</code> function simply increases that number and prints it out. </p>
  
  <p>Inside the <code>Add()</code> Function I call the <code>Add()</code> function.</p>
  
  <p>My program successfully prints out 12000ish numbers before I get a StackOverflow Exception.</p>
  
  <p>So my question = Is there any way to ignore this error and keep counting? </p>
  
  <p>I have tried <code>On Error Resume</code>, <code>Try/Catch</code>, and <code>throw</code></p>
  
  <p>My code is as follows.</p>
  
  <pre><code>Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
      While number1 &lt; 9999999
          Try
              add()
          Catch ex As StackOverflowException
              ''Do Stuff here
          End Try
      End While
  End Sub
  
  
    Function add()
      number1 = number1 + 1
      Trace.WriteLine(number1) ''Error is throw here
      add()
      Return number1
  End Function
  </code></pre>