• Advertisement

Archived

This topic is now archived and is closed to further replies.

clearing the text screen

This topic is 6553 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

How would I go about clearing the screen in text mode using visual c++ 6.0? I know this has been asked before, but I couldnt find the post. Also, how would I set the cursor to a specific position? Thanks! - Daniel http://sw.mtx.net/daniel/

Share this post


Link to post
Share on other sites
Advertisement
I beleve clrscr() will clear the text screen you''ll need to include conio.h its non-standard so you might not have it but every compiler I have ever seen has it.

Share this post


Link to post
Share on other sites
I don''t believe that VC++ 6.0''s version of conio has the clrscr() function in it. I don''t have an answer for your question; just wanted to point this out.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
The following article is available at microsoft''s site. The code is not great, my screen flickers when being cleared. Could be my cheap video card.


HOWTO: Performing Clear Screen (CLS) in a Console Application
ID: Q99261

http://support.microsoft.com/support/kb/articles/Q99/2/61.ASP

Share this post


Link to post
Share on other sites
This is what I use to clear the screen in text mode for Visual C++ 6.0

void GotoXY( int x, int y )


{



HANDLE screen = GetStdHandle( STD_OUTPUT_HANDLE );


COORD _ = { x, y }; SetConsoleCursorPosition( screen, _);



}


 


void ClrScr()


{



HANDLE screen = GetStdHandle( STD_OUTPUT_HANDLE ); DWORD NumberOfCharsWritten;


COORD _ = { 0, 0 };


FillConsoleOutputCharacter ( screen, ' ', 0xffff, _, &NumberOfCharsWritten
);


SetConsoleCursorPosition( screen, _);



}



Edited by - Ranok on 3/10/00 11:33:56 PM

Share this post


Link to post
Share on other sites

  • Advertisement