<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'I have a overstock error Help Please' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'I have a overstock error Help Please' posted on the 'VB.NET' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2013 Programmers Heaven</copyright>
    <pubDate>Sat, 25 May 2013 09:38:07 -0700</pubDate>
    <lastBuildDate>Sat, 25 May 2013 09:38:07 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>I have a overstock error Help Please</title>
      <link>http://www.programmersheaven.com/mb/VBNET/320734/320734/i-have-a-overstock-error-help-please/</link>
      <description>The error is &lt;br /&gt;
&lt;br /&gt;
An unhandled exception of type 'System.StackOverflowException' occurred in system.windows.forms.dll&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Fatal stack overflow error.&lt;br /&gt;
The program '[4016] calulater.exe' has exited with code 0 (0x0).&lt;br /&gt;
&lt;br /&gt;
dose anyone know how to solve this Error.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
~mencecon&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/VBNET/320734/320734/i-have-a-overstock-error-help-please/</guid>
      <pubDate>Tue, 08 Nov 2005 13:09:05 -0700</pubDate>
      <category>VB.NET</category>
    </item>
    <item>
      <title>Re: I have a overstock error Help Please</title>
      <link>http://www.programmersheaven.com/mb/VBNET/320734/320740/re-i-have-a-overstock-error-help-please/#320740</link>
      <description>Usually this is caused by an infinite loop of some sort, specifically 'While' loops which do not have or reach a termination condition.&lt;br /&gt;
&lt;br /&gt;
~rlc&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/VBNET/320734/320740/re-i-have-a-overstock-error-help-please/#320740</guid>
      <pubDate>Tue, 08 Nov 2005 16:16:01 -0700</pubDate>
      <category>VB.NET</category>
    </item>
    <item>
      <title>Re: I have a overstock error Help Please</title>
      <link>http://www.programmersheaven.com/mb/VBNET/320734/320838/re-i-have-a-overstock-error-help-please/#320838</link>
      <description>I still don't understand. Here's my code. you can try to run it, and if you get the error, tell me how to fix it.&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
Public Class Calculator
    Inherits System.Windows.Forms.Form
'#Region Info won't fit. If you need it tell me and I'll send it alone
    Dim c As New Calculator
    Dim opcode As String
    Dim flag As Integer = 0
    Dim flag1 As Integer = 0
    Public Enum Mode
        NumberMode
        OpMode
        EqTo
    End Enum
    Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click
        c.getMode() = Mode.NumberMode
        c.getMode1() = Nothing
        c.firstOperand() = Nothing
        txtDisplay.Text = 0
        flag = 0
    End Sub
    Private Sub btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click, btnMinus.Click, btnMultiply.Click, btnDivide.Click
        If flag = 0 Then
            txtDisplay.Text = c.firstOperand()
            flag = 1
        Else
            Call calc()
        End If
        opcode = sender.text
        c.getMode() = Mode.OpMode
        c.getMode1() = Mode.OpMode
    End Sub
    Private Sub btnSqrt_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSqrt.Click
        If txtDisplay.Text = "" Then
            MsgBox("Enter a number")
        Else
            txtDisplay.Text = c.root(CDec(txtDisplay.Text))
            If IsNumeric(txtDisplay.Text) Then
                If c.getMode1() = Mode.NumberMode Or c.getMode1() = Mode.EqTo Or c.getMode1() = Nothing Then
                    c.firstOperand() = CDec(txtDisplay.Text)
                Else
                    c.secondOperand() = CDec(txtDisplay.Text)
                End If
            Else
                c.getMode1() = Nothing
            End If
        End If
    End Sub
    Private Sub btnLog_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLog.Click
        If txtDisplay.Text = "" Then
            MsgBox("Enter a number")
        Else
            txtDisplay.Text = c.log(CDec(txtDisplay.Text))
            If IsNumeric(txtDisplay.Text) Then
                If c.getMode1() = Mode.NumberMode Or c.getMode1() = Mode.EqTo Or c.getMode1() = Nothing Then
                    c.firstOperand() = CDec(txtDisplay.Text)
                End If
                c.getMode1() = Nothing
            End If
        End If
    End Sub
    Private Sub btnNumber_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn0.Click, btn3.Click, btn2.Click, btn1.Click, btn6.Click, btn5.Click, btn4.Click, btn9.Click, btn8.Click, btn7.Click
        If c.getMode1() = Nothing Then
            If flag1 = 1 Then
                txtDisplay.Text = "0." + sender.tag
                flag1 = 0
            Else
                txtDisplay.Text = sender.tag
            End If
            c.firstOperand() = CDec(txtDisplay.Text)
            c.getMode() = Mode.NumberMode
            c.getMode1() = Mode.NumberMode
        ElseIf c.getMode1() = Mode.NumberMode Then
            If flag1 = 1 Then
                txtDisplay.Text = txtDisplay.Text + "." + sender.tag
                flag1 = 0
            Else
                txtDisplay.Text = txtDisplay.Text + sender.tag
            End If
            c.firstOperand() = CDec(txtDisplay.Text)
        ElseIf c.getMode1() = Mode.OpMode Then
            If c.getMode = Mode.NumberMode Then
                If flag1 = 1 Then
                    txtDisplay.Text = txtDisplay.Text + "." + sender.tag
                    flag1 = 0
                Else
                    txtDisplay.Text = txtDisplay.Text + sender.tag
                End If
                c.secondOperand() = CDec(txtDisplay.Text)
            Else
                If flag1 = 1 Then
                    txtDisplay.Text = "0." + sender.tag
                    flag1 = 0
                Else
                    txtDisplay.Text = sender.tag
                End If
                c.getMode() = Mode.NumberMode
                c.secondOperand() = CDec(txtDisplay.Text)
            End If
        ElseIf c.getMode1() = Mode.EqTo Then
            If flag1 = 1 Then
                txtDisplay.Text = "0." + sender.tag
                flag1 = 0
            Else
                txtDisplay.Text = sender.tag
            End If
            c.firstOperand() = CDec(txtDisplay.Text)
            c.getMode() = Mode.NumberMode
            c.getMode1() = Mode.NumberMode
            flag = 0
        End If
    End Sub
    Private Sub btnEqual_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEqual.Click
        Call calc()
    End Sub
    Private Sub calc()
        If c.getMode() = Mode.NumberMode Then
            c.getMode() = Mode.EqTo
            Select Case opcode
                Case "+"
                    txtDisplay.Text = float(c.Add(c.firstOperand(), c.secondOperand()))
                Case "-"
                    txtDisplay.Text = float(c.Subtract(c.firstOperand(), c.secondOperand()))
                Case "X"
                    txtDisplay.Text = float(c.multiply(c.firstOperand(), c.secondOperand()))
                Case "/"
                    txtDisplay.Text = float(c.divide(c.firstOperand(), c.secondOperand()))
            End Select

            c.getMode1() = Mode.EqTo
            c.firstOperand() = CDec(txtDisplay.Text)
            c.secondOperand() = Nothing
        End If
    End Sub
    Private Sub btnDecimal_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btndot.Click
        flag1 = 1
        If c.getMode1() = Nothing Then
            txtDisplay.Text = "0"
        ElseIf c.getMode1() = Mode.OpMode Then
            If c.getMode &amp;lt;&amp;gt; Mode.NumberMode Then
                txtDisplay.Text = "0"
            End If
        ElseIf c.getMode1() = Mode.EqTo Then
            txtDisplay.Text = "0"
        End If
    End Sub
    Private Sub btnSign_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsign.Click
        txtDisplay.Text = -1 * CDec(txtDisplay.Text)

        If c.getMode1() = Mode.NumberMode Or c.getMode1() = Mode.EqTo Or c.getMode1() = Nothing Then
            c.firstOperand() = CDec(txtDisplay.Text)
        Else
            c.secondOperand() = CDec(txtDisplay.Text)
        End If
    End Sub
    Private Function float(ByVal parm As Decimal) As Decimal
        Dim result As String
        Dim index As Integer
        result = parm.ToString
        index = result.IndexOf(".")
        If (index &amp;lt;&amp;gt; -1 And result.Substring(index + 1, result.Length - index - 1) = "0") Then
            Return (CDec(result.Substring(0, index)))
        Else
            Return (CDec(result))
        End If
    End Function



    Private op1 As Decimal = 0
    Private op2 As Decimal = 0
    Private Shared cMode As String = Nothing
    Private Shared pMode As String = Nothing
    Public Property firstOperand() As Decimal
        Get
            Return op1
        End Get
        Set(ByVal Value As Decimal)
            op1 = Value
        End Set
    End Property
    Public Property secondOperand() As Decimal
        Get
            Return op2
        End Get
        Set(ByVal Value As Decimal)
            op2 = Value
        End Set
    End Property
    Public Property getMode() As String
        Get
            Return cMode
        End Get
        Set(ByVal Value As String)
            cMode = Value
        End Set
    End Property
    Public Property getMode1() As String
        Get
            Return pMode
        End Get
        Set(ByVal Value As String)
            pMode = Value
        End Set
    End Property
    Public Function Add(ByVal first As Decimal, ByVal second As Decimal)
        Dim result As Decimal
        result = first + second
        Return result
    End Function
    Public Function Subtract(ByVal first As Decimal, ByVal second As Decimal)
        Dim result As Decimal
        result = first - second
        Return result
    End Function
    Public Function multiply(ByVal first As Decimal, ByVal second As Decimal)
        Dim result As Decimal
        result = first * second
        Return result
    End Function
    Public Function divide(ByVal first As Decimal, ByVal second As Decimal)
        Dim result As Decimal
        result = first / second
        Return result
    End Function
    Public Function root(ByVal first As Decimal)
        Dim result As String
        If first &amp;lt; 0 Then
            Return "Invalid Input"
        Else
            Return System.Math.Sqrt(first)
        End If
    End Function
    Public Function log(ByVal first As Decimal)
        Dim result As Decimal
        If first &amp;lt; 0 Then
            Return "Invalid Input"
        Else
            Return System.Math.Log(first)
        End If
    End Function
    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn1.Click

    End Sub
    Private Sub btnNumber_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNumber.Click

    End Sub
End Class
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
Please try to figure out how to fix it. It says that "An unhandled exception of type 'System.StackOverflowException' occurred in system.windows.forms.dll" Can you help me figure out how to get it to cooperate?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
~Mencecon&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/VBNET/320734/320838/re-i-have-a-overstock-error-help-please/#320838</guid>
      <pubDate>Wed, 09 Nov 2005 12:32:27 -0700</pubDate>
      <category>VB.NET</category>
    </item>
    <item>
      <title>Re: I have a overstock error Help Please</title>
      <link>http://www.programmersheaven.com/mb/VBNET/320734/320843/re-i-have-a-overstock-error-help-please/#320843</link>
      <description>Figure out where in the code it is breaking and I will look at it.&lt;br /&gt;
&lt;br /&gt;
I will recommend that you use error catching in your code... Like so&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;SomeFunction()
Try
     ' some code 
Catch Ex as exception
    'do whatever with error , write to log pop-up
     msgbox(ex.message)
End Try
End Function&lt;/pre&gt;&lt;br /&gt;
This will stop exceptions from crashing your app and allow you to handle them.&lt;br /&gt;
&lt;br /&gt;
Also to find out where in your code the exception is happening use the debugger. You can set 'breakpoints' by clicking the gray vertical line to the left of your coding area where there is executable code, you will see a red dot. Click the run debug button in toolbar and it will open in debug mode. Once your code gets to a breakpoint you can step line by line through the execution.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
~rlc&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/VBNET/320734/320843/re-i-have-a-overstock-error-help-please/#320843</guid>
      <pubDate>Wed, 09 Nov 2005 13:01:23 -0700</pubDate>
      <category>VB.NET</category>
    </item>
    <item>
      <title>Re: I have a overstock error Help Please</title>
      <link>http://www.programmersheaven.com/mb/VBNET/320734/320942/re-i-have-a-overstock-error-help-please/#320942</link>
      <description>Lame's terms, Please?!?&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/VBNET/320734/320942/re-i-have-a-overstock-error-help-please/#320942</guid>
      <pubDate>Thu, 10 Nov 2005 12:24:22 -0700</pubDate>
      <category>VB.NET</category>
    </item>
    <item>
      <title>Re: I have a overstock error Help Please</title>
      <link>http://www.programmersheaven.com/mb/VBNET/320734/320979/re-i-have-a-overstock-error-help-please/#320979</link>
      <description>: Figure out where in the code it is breaking and I will look at it.&lt;br /&gt;
: &lt;br /&gt;
: I will recommend that you use error catching in your code... Like so&lt;br /&gt;
: &lt;br /&gt;
: &lt;pre class="sourcecode"&gt;SomeFunction()
: Try
:      ' some code 
: Catch Ex as exception
:     'do whatever with error , write to log pop-up
:      msgbox(ex.message)
: End Try
: End Function&lt;/pre&gt;&lt;br /&gt;
: This will stop exceptions from crashing your app and allow you to handle them.&lt;br /&gt;
: &lt;br /&gt;
: Also to find out where in your code the exception is happening use the debugger. You can set 'breakpoints' by clicking the gray vertical line to the left of your coding area where there is executable code, you will see a red dot. Click the run debug button in toolbar and it will open in debug mode. Once your code gets to a breakpoint you can step line by line through the execution.&lt;br /&gt;
: &lt;br /&gt;
: &lt;br /&gt;
: ~rlc&lt;br /&gt;
: &lt;br /&gt;
&lt;br /&gt;
find out which line in your code causes the error... You can do this through the debugger, and using try cacth statements in your ocode. Since it didn't look like you had many loops I would say it is a type conversion issue somewhere.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/VBNET/320734/320979/re-i-have-a-overstock-error-help-please/#320979</guid>
      <pubDate>Thu, 10 Nov 2005 22:38:08 -0700</pubDate>
      <category>VB.NET</category>
    </item>
  </channel>
</rss>