74

Using LINQPad, using the extension method Dump(), Console.WriteLine or Debug.Writeline, the values will appear in the results window.

Is there a way to clear this results window during the run of a linqpad script? As an example, I tried Console.Clear() however this throws an exception

wonea
  • 4,783
  • 17
  • 86
  • 139
Ray Booysen
  • 28,894
  • 13
  • 84
  • 111

1 Answers1

134

I've added a feature to do this

Util.ClearResults();
ΩmegaMan
  • 29,542
  • 12
  • 100
  • 122
Joe Albahari
  • 30,118
  • 7
  • 80
  • 91
  • How about implementing a progress spinner writing to the console ? I tried to do a Console.Write and Console.Clear() which gave an error. Switching to Util.ClearResults in a tight loop with Thread.Sleep of 100 ms between each iteration to "rotate" the console spinner, gave no output at all using Util.ClearResults .. – Tore Aurstad May 09 '20 at 22:30
  • 1
    LINQPad lets you dump progress bars: http://share.linqpad.net/rx7h34.linq . You can implement a spinner as follows: http://share.linqpad.net/av2a4w.linq – Joe Albahari May 11 '20 at 00:46
  • For the second snippet (spinner one), I got `'Util' does not contain a definition for 'HtmlHead'` error message. Seems like the second snippet only works on `v7.x` – Mehdi Dehghani Jun 22 '22 at 04:03