Start New Discussion within our Software Development Community

Hello, I'm trying to Convert "{MATH}TextBoxC1+TextBoxC1" to "TextBox1.Text=Convert.ToString(Convert.ToInt32(TextBoxC1.Text)+Convert.ToInt32(TextBoxC1.Text)); but doing it using one textbox.. I'm making a software creator. Everything was working well but this... Thanks in advance

                        string svs = texttyped; //which is "{MATH}TextBoxC1+TextBoxC1
                        svs = svs.Remove(0, 6);
                        string x = controlname + ".Text=Convert.ToString(Convert.ToInt32("; //ControlName = "TextBox1"
                        while (svs != "")
                        {
                            while (svs != "" || !svs.StartsWith("*") || !svs.StartsWith("/") || !svs.StartsWith("+") || !svs.StartsWith("-"))
                            {
                                try
                                {
                                    x += svs.Remove(1);
                                    svs = svs.Remove(0, 1);
                                }
                                catch { x += svs; svs = ""; break; }
                            }
                            if (svs != "")
                            {
                                x = x + ")" + svs.Remove(1) + "Convert.ToInt32(";
                            }
                            x += ".Text));";
                        }

Your question is pretty hard to understand.

Do you want svs to repeat the value of TextBoxC1 and x to contain the value of TextBox1?

What is {MATH}?

What errors do you get?

This article has been dead for over six months. Start a new discussion instead.