Fan.Sys.ParseErr.make C# (CSharp) Method

make() public static method

public static make ( ) : ParseErr
return ParseErr
        public static new ParseErr make()
        {
            return make("", (Err)null);
        }

Same methods

ParseErr::make ( string msg ) : ParseErr
ParseErr::make ( string msg, Err cause ) : ParseErr
ParseErr::make ( string type, string val ) : ParseErr
ParseErr::make ( string type, string val, object more ) : ParseErr

Usage Example

Beispiel #1
0
        public static Date fromStr(string s, bool check)
        {
            try
            {
                // YYYY-MM-DD
                int year  = num(s, 0) * 1000 + num(s, 1) * 100 + num(s, 2) * 10 + num(s, 3);
                int month = num(s, 5) * 10 + num(s, 6) - 1;
                int day   = num(s, 8) * 10 + num(s, 9);

                // check separator symbols
                if (s[4] != '-' || s[7] != '-' || s.Length != 10)
                {
                    throw new System.Exception();
                }

                return(new Date(year, month, day));
            }
            catch (System.Exception)
            {
                if (!check)
                {
                    return(null);
                }
                throw ParseErr.make("Date", s).val;
            }
        }
All Usage Examples Of Fan.Sys.ParseErr::make