Example #1
0
        public override String Execute(Context context)
        {
            int    e1, e2;
            String str1 = _exp1.Execute(context);
            String str2 = _exp2.Execute(context);

            if (int.TryParse(str1, out e1) && int.TryParse(str2, out e2))
            {
                return(Convert.ToString(e1 - e2));
            }
            throw new Exception("Віднімання рядків");
        }
Example #2
0
        public override String Execute(Context context)
        {
            int    e1, e2;
            String str1 = _exp1.Execute(context);
            String str2 = _exp2.Execute(context);

            if (int.TryParse(str1, out e1) && int.TryParse(str2, out e2))
            {
                return(Convert.ToString(e1 + e2));
            }
            return(str1 + str2);
        }
Example #3
0
        public override String Execute(Context context)
        {
            int    e1, e2;
            String str1 = _exp1.Execute(context);
            String str2 = _exp2.Execute(context);

            if (int.TryParse(str1, out e1) && int.TryParse(str2, out e2))
            {
                return(e1 <= e2 ? "true" : "false");
            }
            return("false");
        }
Example #4
0
 public override String Execute(Context context)
 {
     return(_exp.Execute(context));
 }