Reverse Polish Notation: Grabbing values from input textbox to perform calculation
<p>I am a novice C# coder and currently working on a Reverse polish notation calculator. I created a method that will take care of the calculations but there are three lines in my code that are causing an error. After every <code>=</code> an operation is performed and then displayed. I am trying to grab the string from <code>TxtInputBox</code> and convert to integers but the following line is where I am getting a red squiggly line: <code>string[] inputarray = TxtBoxInputbox.Text.Split();</code>. Second when calling the function RPNCalc from button click <code>Btn_Calc</code> and assigning the textBoxes I receive another red squiggly line: <code>RPNCalc(TxtInputBox, TxtOutputBox);</code> I am not sure how to deal with these two errors that keep my form from working. Please help in making error free. </p>

<p><strong>Code</strong></p>

<pre><code>namespace rpncalc
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void RPNCalc(TxtBoxInputbox, TxtBoxOutputbox)
        {
            Stack&lt;int&gt; stackone = new Stack&lt;int&gt;();
            stackone.Clear();
            string[] inputarray = TxtBoxInputbox.Text.Split();
            int end = inputarray.Length - 1;
            int numinput;
            int i = 0;

            do
            {
                if(inputarray[i] != "=" &amp;&amp; inputarray[i] != "+" &amp;&amp; inputarray[i] != "-" &amp;&amp; inputarray[i] != "*" &amp;&amp; inputarray[i] != "/")  
                {
                    try
                    {
                        numinput = Convert.ToInt32(inputarray[i]);
                        stackone.Push(numinput);
                    }
                    catch
                    {
                        MessageBox.Show("Please check the input");
                    }
                }

                    else if (inputarray[i]== "+")
                    {
                        try
                        {
                            int store1 = stackone.Pop();
                            int store2 = stackone.Pop();
                            stackone.Push(store2 + store1);
                        }
                        catch
                        {
                        }
                    }

                    else if (inputarray[i]== "-")
                    {
                        try
                        {
                            int store1 = stackone.Pop();
                            int store2 = stackone.Pop();
                            stackone.Push(store2 + store1);
                        }
                        catch
                        {
                        }
                    }

                    else if (inputarray[i]== "+")
                    {
                        try
                        {
                            int store1 = stackone.Pop();
                            int store2 = stackone.Pop();
                            stackone.Push(store2 + store1);
                        }
                        catch
                        {
                        }
                    }

                    else if (inputarray[i]== "*")
                    {
                        try
                        {
                            int store1 = stackone.Pop();
                            int store2 = stackone.Pop();
                            stackone.Push(store2 + store1);
                        }
                        catch
                        {
                        }
                    }

                    else if (inputarray[i]== "/")
                    {
                        try
                        {
                            int store1 = stackone.Pop();
                            int store2 = stackone.Pop();
                            stackone.Push(store2 + store1);
                        }
                        catch
                        {
                        }
                    }

            }
            while(i &lt; end &amp;&amp; inputarray[i]!= "=" &amp;&amp; stackone.Count != 0);
            string txtout = TxtInputBox + " " + stackone.Pop().ToString() + Environment.NewLine;
            TxtOutputBox.AppendText(txtout);
            TxtInputBox.Clear();

        }

        private void Btn_Calc_Click(object sender, EventArgs e)
        {
            RPNCalc(TxtInputBox, TxtOutputBox);
        }

    }
}
</code></pre>

<p><img src="http://i.stack.imgur.com/VONK8.jpg" alt="enter image description here"></p>
