Ejemplo n.º 1
0
        /// <summary>
        /// Get the index of [Table_column]
        /// </summary>
        public void Calculate()
        {
            string tc_str = this.Table_Column.Value;

            if (string.IsNullOrEmpty(tc_str))
            {
                return;
            }

            int index = 0, baseTen = 1, checkCount = 0;

            for (int i = tc_str.Length - 1; i >= 0; --i)
            {
                char c = tc_str[i];
                if (!HssStr.IsNum(c))
                {
                    break;
                }

                index   += (c - '0') * baseTen;
                baseTen *= 10;

                if (++checkCount >= DTC_Position_Headers.max_charCheckCount)
                {
                    break;
                }
            }

            if (checkCount > 0)
            {
                this.TableCol_index = index;
            }
        }