News on clearing screen commands!!!

Apostolis Rudis apostolis at mail.com
Wed Sep 15 00:50:17 EEST 1999


ÈõìÜóôå ôï thread ó÷åôéêÜ ìå ôçí åíôïëÞ ðïõ øÜ÷íáìå; ÐáñÜ ôï ãåãïíüò üôé
äåí ìðüñåóá áêüìç íá ôá êáôáöÝñù ìå ôçí curses.h, ìéá éäÝá ðïõ Ýñéîå
êÜðïéïò áðü Ýíá newsgroup ôçò C++ Ýðéáóå ôüðï!

Ôï ðáñáêÜôù ðáñÜäåéãìá äåß÷íåé ôïí êáèáñéóìü ôçò ïèüíçò óå ðåñéâÜëëïí
DOS, áí êÜðïéïò åîáêïëïõèåß íá ðñïãñáììáôßæåé ó' áõôü.

Ãéá ôï áíôßóôïé÷ï ôïõ linux, ôï ìüíï ðïõ ÷ñåéÜæåôáé åßíáé íá ãßíåé
áíôéêáôÜóôáóç, þóôå óôï ðñþôï #define íá ìðåé ç äÞëùóç "cls" êáé óôï
äåýôåñï ç "clear", ãéá íá ëåéôïõñãÞóåé. (Áëëéþò âãÜæåé ìÞíõìá bad
command or file name êáé äåí êÜíåé clearing ôçí ïèüíç, ëïãéêÜ...).

Óçìåßùóç: Ãéá ôï DOS ÷ñçóéìïðïßçóá ôïí gpp compiler ôïõ djgpp
(version 2.95), åíþ ãéá ôï linux ôï gpp ðïõ åß÷å ôï SUSE 6.1

Óôçí ðñþôç ðåñßðôùóç: gpp koko.cpp -o koko.exe -s
óôç äåýôåñç, gpp koko.cpp -o koko -s

Áí Ý÷åôå äéáöïñåôéêïýò compilers (ð÷ Borland or whatever) êáé äå
âáñéÝóôå, êÜíôå Ýíá compile êáé ðåßôå ìïõ áí Ýôñåîå...

ÊáëÜ, ôï ó÷ïëéÜæù êáêåíôñå÷þò áëëÜ äåí áíôÝ÷ù! Óôï Linux ôï åêôåëÝóéìï
âãÞêå ãýñù óôá 5,7 kb, åíþ óôï Dos ðÜíù áðü 145 kb...

#include <iostream.h>
#include <stdlib.h>

#ifdef UNIX
#define CLRSCREEN() system("clear")
#else
#define CLRSCREEN() system("cls")
#endif

int main()
{
    { CLRSCREEN(); }

	cout << ("\tYou have just cleared the screen. Congratulations!!!\n");
	cout << ("\n\t\t\tbla, bla, bla... \n");

    return 0;
}


Åõ÷áñéóôþ üëïõò üóïõò åß÷áí ôçí êáëÞ äéÜèåóç íá äþóïõí ìéá ëýóç óôï
ðñüâëçìá êé åëðßæù íá áðïâåß ÷ñÞóéìç ç ðáñáðÜíù ëýóç óå êÜðïéïí áð'
üëïõò óáò, êÜðïéá óôéãìÞ.

Muchas gracias...


         Apostolis
apostolis at mail.com
--
====================================================================
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