Esempio n. 1
0
        public int ColName2Id(string colName)
        {
            string idStr = colName.Substring(3);
            int    id    = (int)Utils.ConvertToDouble(idStr);

            return(id);
        }
Esempio n. 2
0
 public void Set(int index, string value)
 {
     if (DataModel.ColTypes[index] == DataModel.COL_TYPE.STRING)
     {
         m_str[index] = value;
     }
     else
     {
         m_num[index] = Utils.ConvertToDouble(value);
     }
 }
Esempio n. 3
0
        protected override Variable Evaluate(ParsingScript script)
        {
            List <Variable> args = script.GetFunctionArgs();

            Utils.CheckArgs(args.Count, 1, m_name, true);
            Variable arg = args[0];

            double result = Utils.ConvertToDouble(arg.AsString());

            return(new Variable(result));
        }
Esempio n. 4
0
        protected override Variable Evaluate(ParsingScript script)
        {
            // First check if the passed expression is a string between quotes.
            if (Item.Length > 1 &&
                Item[0] == Constants.QUOTE &&
                Item[Item.Length - 1] == Constants.QUOTE)
            {
                return(new Variable(Item.Substring(1, Item.Length - 2)));
            }

            // Otherwise this should be a number.
            double num = Utils.ConvertToDouble(Item, "StringOrNumber");

            /*if (!Double.TryParse(Item, NumberStyles.Number |
             *                   NumberStyles.AllowExponent |
             *                   NumberStyles.Float,
             *                   CultureInfo.InvariantCulture, out num)) {
             * Utils.ThrowException(script, "parseToken", Item, "parseTokenExtra");
             * }*/
            return(new Variable(num));
        }