C# Console Application

kbjradmin

New Member
Messages
512
Reaction score
2
Points
0
i know that in a c# console application, you can write text to the screen with:
Code:
Console.WriteLine("text...");
but is there some way to then modify the text i have already writen?

i am writing a program that processes information in batches and want to have a running total on the screen of many loops have been completed, but don't want to write a new line each time (because that just looks stupid).

please help.
 

Livewire

Abuse Compliance Officer
Staff member
Messages
18,169
Reaction score
216
Points
63
Console.Clear();

Then re-write the entire screen's data.



Clumsy yes but it should work. You might wanna make a method called ScreenWrite or something similar that writes the entire console's data, so it is easier to modify and print the data that's needed.
 

kbjradmin

New Member
Messages
512
Reaction score
2
Points
0
i thought of doing something like this, but wanted to know if there was a better way.

btw, i am still open to another suggestion if there is a better way...
 
Last edited:

kbjradmin

New Member
Messages
512
Reaction score
2
Points
0
thank you, misson, Console.SetCursorPosition() worked perfectly. i would have given rep, but i've already given you some recently, so it won't let me.
 
Last edited:

Livewire

Abuse Compliance Officer
Staff member
Messages
18,169
Reaction score
216
Points
63
thank you, misson, Console.SetCursorPosition() worked perfectly. i would have given rep, but i've already given you some recently, so it won't let me.

I repped him for both of us; I wish I had known about that 2 console apps ago.


Freakin' wrote a whole method to clear the screen and redraw everything, couldve just used that to rewrite what I needed.
 
Top