Пример #1
0
        public bool Assign(string str)
        {
            int l = str.Length;

            if (l == 0)
            {
                str = "0";
            }
            if (strIsValue(str, l))
            {
                vtype = QuestTCPVType.vtExt;
                vd.Clear();

                if (!double.TryParse(str.Replace(',', '.'), out vf))
                {
                    vf = 0;
                }
                return(true);
            }
            if ((l > 1) && (str[0] == '[') && (str[l - 1] == ']'))
            {
                char[] chs = { 'h', ';', '[', ']', '-' };
                for (int i = 0; i < l; i++)
                {
                    char c = str[i];

                    if (((c >= '0') && (c <= '9')) || chs.Contains(c))
                    {
                        continue;
                    }
                    return(false);
                }
                vtype = QuestTCPVType.vtRange;
                vd.Assign(str);
                vf = 0;
                return(true);
            }
            return(false);
        }
Пример #2
0
 public void CopyDataFrom(QuestTCPVariant source)
 {
     vd.CopyDataFrom(source.vd);
     vf    = source.vf;
     vtype = source.vtype;
 }
Пример #3
0
 public void Clear()
 {
     vf = 0;
     vd.Clear();
     vtype = QuestTCPVType.vtExt;
 }