Beispiel #1
0
        private void calculate()
        {
            String expr = textBox1.Text;

            textBox1.Clear();
            textBox1.Text = SevenConverter.FromDec(Expression.ParseExpr(ref expr));
        }
Beispiel #2
0
        public static int ParseNumber(ref string expr)
        {
            string numberTemp    = "";
            int    initialLength = expr.Length;

            for (int i = 0; i < initialLength; i++)
            {
                if (char.IsDigit(expr[0]))
                {
                    numberTemp += expr[0];
                    expr        = expr.Substring(1, expr.Length - 1);
                }
                else
                {
                    break;
                }
            }

            return(SevenConverter.ToDec(numberTemp));
        }