示例#1
0
        /// <summary>
        /// Get numeric value
        /// </summary>
        /// <param name="sourse"></param>
        /// <returns></returns>
        private long GetNumericValue(string p)
        {
            long n = -1;

            try
            {
                string ost = "";
                string ist = GetStringValue(p);
                for (int i = 0; i < ist.Length; i++)
                {
                    int    res = 0;
                    string sym = ist.Substring(i, 1);
                    if (int.TryParse(sym, out res))
                    {
                        ost += sym;
                    }
                    else
                    {
                        break;
                    }
                }
                n = VSLib.ConvertStringToLong(ost);
            }
            catch (Exception e1)
            {
                this.Error = e1.Message;
                return(-1);
            }
            return(n);
        }