Example #1
0
        private static Object ParseIntLongByte(String arg, int factor)
        {
            // try to parse as an int first, else try to parse as a long
            try
            {
                return IntValue.ParseString(arg)*factor;
            }
            catch (OverflowException e1)
            {
                try
                {
                    return (Int64) (LongValue.ParseString(arg)*factor);
                }
                catch
                {
                }

                throw;
            }
            catch (FormatException e1)
            {
                try
                {
                    return (Int64) (LongValue.ParseString(arg)*factor);
                }
                catch (Exception)
                {
                    try
                    {
                        return (Byte) (ByteValue.ParseString(arg)*factor);
                    }
                    catch (Exception)
                    {
                        throw e1;
                    }
                }
            }
        }