I was looking at methods of clearing the screen. I remember using
clrscr() in C on a Unix machine when I was at the institute learning
software development. I tried using it on MS VC++ 6.0. It didn't work.
I looked up the documentation. The documentation said this is a
non-standard function and is included in conio.h. I had included
conio.h already, and yet it couldn't link. I guess clrscr is a unix
thing then?
I also found this code in a book as well as on the Net about clearing
the screen:
THIS CAME FROM A DOWNLOADED SAMPLE
printf("\033[2J"); /* Clear the entire screen. */
printf("\033[0;0f"); /* Move cursor to the top left hand corner */
THIS CAME FROM A BOOK
printf("\x1B[2J");
I also found some documentation saying there was this library called
curses that was very interesting and it dealt with screen handling
functions. I looked it up on Google and found the documentation for
the header curses.h and an overview. But I think I'll also need the
DLL along with the header, so I can use the curses.
My questions are:
(1) Why is it that the phrase "\x1B[2J" should cause the screen to
clear?
(2) Why doesn't it work for me?
(3) Where can I get the necessary files to use curses? Where can I get
some tutorial on using curses, because I saw there was no function to
create a window/console, but there were functions for manipulating
windows (example colorwindow etc.) and they all expected a WINDOW data
type (that's no problem, that's declared in the header, but how do I
fetch a window's. Should I just use the Win32 API GetWindow etc?
Surely, it wouldn't be a Win32 platform specific library - this
curses?).