2 Replies - 1639 Views - Last Post: 07 April 2010 - 03:35 PM Rate Topic: -----

#1 kevin_06s  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 26-January 10

Refresh Parts of Console Application

Posted 07 April 2010 - 02:54 PM

I am wondering if there is any way to selectively clear parts of a console application, such as from (0,0) to (50, 50), as opposed to system("cls") to clear the whole screen. If possible, I would like to avoid having to store the contents of the screen into an array, clear out the whole screen, then put back the parts of the array that were not cleared.
Is This A Good Question/Topic? 0
  • +

Replies To: Refresh Parts of Console Application

#2 jjl  Icon User is offline

  • Engineer
  • member icon

Reputation: 1072
  • View blog
  • Posts: 4,532
  • Joined: 09-June 09

Re: Refresh Parts of Console Application

Posted 07 April 2010 - 02:58 PM

nope, you cant just clear a section of the console.
Was This Post Helpful? 0
  • +
  • -

#3 Aphex19  Icon User is offline

  • Born again Pastafarian.
  • member icon

Reputation: 614
  • View blog
  • Posts: 1,873
  • Joined: 02-August 09

Re: Refresh Parts of Console Application

Posted 07 April 2010 - 03:35 PM

Maybe you could go some of the way to doing that with the gotoxy() function.

#include <windows.h>

void gotoxy(int x, int y)
{
   COORD coord;
   coord.X = x;
   coord.Y = y;
   SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_H ANDLE), coord);
}

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1