Clear Screen function in C++

Giorgos Keramidas keramida at hades.hell.gr
Wed Sep 8 23:38:01 EEST 1999


On Wed, Sep 08, 1999 at 11:17:19PM -0700, Balafoutis Hlias wrote:
|   Den epiasa to thread apo thn arxh ...  opote mporei na grafw kotsana 
| alla to system("clear") den sou kanei?

Oxi dev tou kavei, giati sta misa Unix n system("") exei tosa bugs pou
prepei va apofeugetai meta mavias.

Kai giati uparxouv xilioi duo alloi tropoi va kavei clear() oxi movo se C++
alla kai se C, kai se Bourne shell, kai se Perl, kai se Python, akoma kai
stn Fortran (theos fulaksoi), arkei va steilei kapws sto termatiko tou to
string me ta escapes pou faivetai parakato:

	"\033[0m\033[2J\033[H"

to opoio se C++ givetai paveukola me tnv:

	cout << AUTO_TO_PALABO_STRING;

kai se apln C me:

	printf("%s", AUTO_TO_PALABO_STRING);
	fflush(stdout); /* gia na adeiasoun ta kaka buffers */

Ah, kai sto <curses.h> uparxei kai n erase() avtistoixn tns clear(), kai eva
karo alles functions, polu omorfes, alla kai polu spastikes afou exouv ta
manual pages tous teleiws avakatemeva.

-- 
Giorgos Keramidas, <keramida at ceid.upatras.gr>
Public PGP key at finger://keramida@diogenis.ceid.upatras.gr/
"Today is not yesterday's tomorrow, but tomorrow's yesterday."
--
====================================================================
Gia boithia (h na diagrafhte) e-mail sto majordomo at hellug.gr
Ta archives tis listas einai sto http://lists.hellug.gr/archives
prin steilete kapoia erothsh psakte mipos exei hdh apanththei.
Gia opoiodipote problima stilte e-mail ston owner-linux-greek-users at hellug.gr
====================================================================



More information about the Linux-greek-users mailing list