double B4(string _str) { if (_str == "") { Console.WriteLine("Пустая строка: " + _str); return(-200000000.123); } else { if (Uel(_str) == 0) { try { return(Convert.ToDouble(_str)); } catch { FormatException ex = new FormatException("Kak Tak?"); Console.WriteLine(ex.ToString()); return(-200000000.125);//хз чо жто } } else { if (Perem(_str) == 0) { if (List_Perem.Contains(_str)) { if (Perem_Value[List_Perem.IndexOf(_str)] != -21038135135) { return(Perem_Value[List_Perem.IndexOf(_str)]); } else { Console.WriteLine("Использована переменаня, которое не присвоено значение " + _str); return(-200000000.124); } } else { Console.WriteLine("Использована необозначенная ранее переменаня " + _str); return(-200000000.124); } } else { Console.WriteLine("Неизвестный текст: " + _str); return(-200000000.124); } } } }
/// <summary> /// A short cut for string.Format() /// </summary> /// <param name="format">The format.</param> /// <param name="parameters">The parameters.</param> /// <returns>The target string.</returns> public static string FormatWith(this string format, params object[] parameters) { try { return(string.Format(format, parameters)); } catch (FormatException ex) { var callerInfo = string.Format("{0}.format(\"{1}\")", format, string.Join("\", \"", parameters)); var newException = new FormatException( string.Format("Format exception met when processing `{0}`.", callerInfo)); var exceptionString = newException.ToString(); throw new FormatException(exceptionString); } }