Link to home
Start Free TrialLog in
Avatar of JBURGHARDT
JBURGHARDT

asked on

refresh screen

How I can refresh screen when i start my program.
Avatar of ramaswamys
ramaswamys

You can use 'xrefresh' - a standard application that ships with most Unix and Linux distributions.

Ramaswamy
Avatar of JBURGHARDT

ASKER

well I want to know this using c++ since this is programing question
how to use clrscr(); refresh(),
Oops, Sorry ! Well if you want to clear a terminal please refer to the curses library documentation or If you are doing X-windows programming you have calls like XClearArea(), XClearWindow(), etc.

Good Luck
Ramaswamy
There are also the generic terminal escape sequences that may or may not work (it really depends on the terminal).
ie: ESC[2J (\x1B[2J) is used to clear the screen and it's also supposed to home the cursor.  I've used this particular sequnce a lot and it generally works (both in C and C++).
Here are some macros you could use as paitre sugested below:

#define CCLR "\033\143\x1B[2J" /* reset and clear screen */

Also if you're interested:

#define CUDL  "\x1B[4m" /* underline */
#define CFSH  "\x1B[5m" /* flashing (mihgt not work, depending on your  term) */
#define CRVS  "\x1B[7m" /* reverse video */
#define CNRM  "\x1B[0;0m" /* normal (disable special attributes) */
using ansi escape sequences is extremely evil and unportable
one should definately use a terminal capability database
such as termcap or terminfo
this is comfortably done by using a library
such as ncurses or slang , both easily found on freshmeat
for small manipulations, such a library is too much of an
overhead, so termcap or terminfo should be consulted
directly.
ASKER CERTIFIED SOLUTION
Avatar of pessoa
pessoa

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Adjusted points to 400