0

I'm trying to calculate the percentage on the textbox by using the next code:

t45.Text = (CDbl(Me.t43.Text) / CDbl(Me.t48.Text))

but I faced the next message: System.StackOverflowException

what the problem???!

I tried to find what happened but I didn't find.

  • 1
    What's the values of t43 and t48 when the exception is thrown? – HardCode Oct 24 '19 at 16:43
  • 3
    You should use [`Option Strict On`](https://stackoverflow.com/a/29985039/1115360) - it will point out some problems for you and suggest corrections. For example, it would tell you that you can't assign a Double (the result of the calculation) to a String (what the .Text property is). – Andrew Morton Oct 24 '19 at 17:07
  • 1
    Something is missing. `a = b / c` won't raise a StackOverflowException if b and c are simply values. But if `b = a`, then you have recursion and you could get that exception. Double supports Infinity, so even if you *think* you may have a mathematical overflow, (i.e. t48 = 0) your math should work and t45 will be ∞. Look elsewhere. – djv Oct 24 '19 at 20:02
  • Maybe look at the exception. It contains diagnostic information, including the stack trace. – jmcilhinney Oct 24 '19 at 22:55

0 Answers0