Esempio n. 1
0
        public static string FormatError(WinWrap.Basic.Error error)
        {
            var sb = new StringBuilder();

            if (error != null)
            {
                sb.AppendLine(error.File);
                if (File.Exists(error.File))
                {
                    string[] lines = File.ReadAllLines(error.File);
                    string   line  = lines[error.Line - 1];
                    if (error.Offset >= 0)
                    {
                        line = line.Insert(error.Offset, "<here>");
                    }
                    line = string.Format(@"{0:00}:{1}", error.Line, line);
                    sb.AppendLine(line);
                }
                sb.AppendLine(error.Text);
                sb.AppendLine("");
            }
            return(sb.ToString());
        }
Esempio n. 2
0
 private void LogError(WinWrap.Basic.Error error)
 {
     LogError(Examples.SharedSource.WinWrapBasic.FormatError(error));
 }