Exemplo n.º 1
0
 /**
  * uses the relevant flags to decode the StringEval
  * @param eval
  */
 private ValueEval XlateRefStringEval(StringEval sve)
 {
     if ((flags & REF_STRING_IS_PARSED) > 0)
     {
         String s = sve.StringValue;
         double d = OperandResolver.ParseDouble(s);
         if (double.IsNaN(d))
         {
             return(ErrorEval.VALUE_INVALID);
         }
         return(new NumberEval(d));
     }
     // strings are blanks
     return(BlankEval.instance);
 }
Exemplo n.º 2
0
        /**
         * uses the relevant flags to decode the StringEval
         * @param eval
         */
        private ValueEval XlateStringEval(StringEval eval)
        {
            if ((flags & STRING_IS_PARSED) > 0)
            {
                String s = eval.StringValue;
                double d = OperandResolver.ParseDouble(s);
                if (double.IsNaN(d))
                {
                    return(ErrorEval.VALUE_INVALID);
                }
                return(new NumberEval(d));
            }
            // strings are errors?
            if ((flags & STRING_IS_INVALID_VALUE) > 0)
            {
                return(ErrorEval.VALUE_INVALID);
            }

            // ignore strings
            return(XlateBlankEval(BLANK_IS_PARSED));
        }