473,597 Members | 2,342 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ANSI clear screen [MS & Borland]

Hi,

I am trying to clear the screen in my program.
I am loking for something that will work on all compilers, especially
Borland & MS Visual Studio 6.
On Visual studio I used 'system("cls"); ' and this works fine but this
won't work for Borland.
On Borland I used 'clrscr() ' function and it worked ok, but not for
Visual Studio.

Is there anything that will clear the screen in both and maybe also
work on gcc?
In Borland I want to use 'easywin.exe' instead of the console window
and clear the screen.

I thought that 'system("cls"); ' would work with this?

Any ideas?

Thanks in advance,
Ritchie
Nov 13 '05 #1
20 8136
Search for "Microsoft Knowledge Base Article - 99261"

That should work on both compilers given that you're making a win32 console
application.

--

Elias

"ritchie" <ri*********@ya hoo.com> wrote in message
news:3b******** *************** ***@posting.goo gle.com...
Hi,

I am trying to clear the screen in my program.
I am loking for something that will work on all compilers, especially
Borland & MS Visual Studio 6.
On Visual studio I used 'system("cls"); ' and this works fine but this
won't work for Borland.
On Borland I used 'clrscr() ' function and it worked ok, but not for
Visual Studio.

Is there anything that will clear the screen in both and maybe also
work on gcc?
In Borland I want to use 'easywin.exe' instead of the console window
and clear the screen.

I thought that 'system("cls"); ' would work with this?

Any ideas?

Thanks in advance,
Ritchie

Nov 13 '05 #2
ritchie wrote:

I am trying to clear the screen in my program.
I am loking for something that will work on all compilers,
especially Borland & MS Visual Studio 6.


Since you carefully read the FAQ, you are now aware that this
cannot be done in standard C. About the closest you can come is:

puts("\n\n\n\n\ n\n\n\n\n\n\n\n \n\n\n\n\n\n\n\ n\n\n\n\n");

and you may need to adjust the \n count.

After all that, don't do it. There is nothing more annoying than
gratuitious screen clearings from imbecelic programs removing data
I want to remain visible.

--
Chuck F (cb********@yah oo.com) (cb********@wor ldnet.att.net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home .att.net> USE worldnet address!

Nov 13 '05 #3
CBFalconer wrote:
Since you carefully read the FAQ, you are now aware that this
cannot be done in standard C. About the closest you can come is:

puts("\n\n\n\n\ n\n\n\n\n\n\n\n \n\n\n\n\n\n\n\ n\n\n\n\n");

and you may need to adjust the \n count.
And that (as you know) isn't a portable technique either.

After all that, don't do it. There is nothing more annoying than
gratuitious screen clearings from imbecelic programs removing data
I want to remain visible.


Nothing wrong with clearing the screen (by which I really mean the current
terminal window), as long as he puts the old data back afterwards. :-)

--
Richard Heathfield : bi****@eton.pow ernet.co.uk
"Usenet is a strange place." - Dennis M Ritchie, 29 July 1999.
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
K&R answers, C books, etc: http://users.powernet.co.uk/eton
Nov 13 '05 #4
Greetings.

In article <3b************ **************@ posting.google. com>, ritchie
wrote:
Is there anything that will clear the screen in both and maybe also
work on gcc?


Maybe putchar('\f').. . if that doesn't work, use the compiler-provided
implementations and wrap them around #defines. (Presumably each
compiler will #define some macro identifying it. I know GCC does. If
Borland and Microsoft don't, you're probably out of luck.)

--
_
_V.-o Tristan Miller [en,(fr,de,ia)] >< Space is limited
/ |`-' -=-=-=-=-=-=-=-=-=-=-=-=-=-=-= <> In a haiku, so it's hard
(7_\\ http://www.nothingisreal.com/ >< To finish what you
Nov 13 '05 #5
Richard Heathfield <do******@addre ss.co.uk.invali d> wrote:
CBFalconer wrote:


[How to clear screen]
After all that, don't do it. There is nothing more annoying than
gratuitious screen clearings from imbecelic programs removing data
I want to remain visible.


Nothing wrong with clearing the screen (by which I really mean the current
terminal window), as long as he puts the old data back afterwards. :-)


No need to put it back. I use a damp cloth and a tiny little bit of
detergent to clear the screen, and the data doesn't get rubbed off -
it stays nice and clear where it was. :)
--
Irrwahn Grausewitz (ir*******@free net.de)
welcome to clc : http://www.angelfire.com/ms3/bchambl...me_to_clc.html
clc faq-list : http://www.eskimo.com/~scs/C-faq/top.html
acllc-c++ faq : http://www.contrib.andrew.cmu.edu/~a...acllc-c++.html
Nov 13 '05 #6
On Sat, 06 Dec 2003 21:19:40 +0100, in comp.lang.c , Irrwahn
Grausewitz <ir*******@free net.de> wrote:
Richard Heathfield <do******@addre ss.co.uk.invali d> wrote:
CBFalconer wrote:


[How to clear screen]
> After all that, don't do it. There is nothing more annoying than
> gratuitious screen clearings from imbecelic programs removing data
> I want to remain visible.


Nothing wrong with clearing the screen (by which I really mean the current
terminal window), as long as he puts the old data back afterwards. :-)


No need to put it back. I use a damp cloth and a tiny little bit of
detergent to clear the screen, and the data doesn't get rubbed off -
it stays nice and clear where it was. :)


I tried this on my teletype and now my doctor says I'll have to write
wrong-handed till the burns heal. :-(

--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.angelfire.c om/ms3/bchambless0/welcome_to_clc. html>
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Nov 13 '05 #7
Mark McIntyre wrote:
I tried this on my teletype and now my doctor says I'll have to write
wrong-handed till the burns heal. :-(


Worse - I tried it on my CNC router and now I have mortise and
tenon joints...

--
Morris Dovey
West Des Moines, Iowa USA
C links at http://www.iedu.com/c
Read my lips: The apple doesn't fall far from the tree.

Nov 13 '05 #8
On Sat, 06 Dec 2003 16:56:38 -0600, in comp.lang.c , Morris Dovey
<mr*****@iedu.c om> wrote:
Mark McIntyre wrote:
I tried this on my teletype and now my doctor says I'll have to write
wrong-handed till the burns heal. :-(


Worse - I tried it on my CNC router and now I have mortise and
tenon joints...


See, these problems wouldn't arise if people didn't give offtopic
answers here. Any fule kno that your kind of router is pronounced to
rhyme with shouter, and the sort you /should/ have wiped with solvent
is pronounced to assonate with tooter. If only you yanks could learn
to spel too, we'd be laffin.
--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.angelfire.c om/ms3/bchambless0/welcome_to_clc. html>
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Nov 13 '05 #9
Richard Heathfield wrote:
CBFalconer wrote:
Since you carefully read the FAQ, you are now aware that this
cannot be done in standard C. About the closest you can come is:
^^^^^^^

puts("\n\n\n\n\ n\n\n\n\n\n\n\n \n\n\n\n\n\n\n\ n\n\n\n\n");

and you may need to adjust the \n count.
And that (as you know) isn't a portable technique either.


Note underlined word above :-)
After all that, don't do it. There is nothing more annoying than
gratuitious screen clearings from imbecelic programs removing data
I want to remain visible.


Nothing wrong with clearing the screen (by which I really mean the
current terminal window), as long as he puts the old data back
afterwards. :-)


Disagree. Consider a calculator program. While using it I want
the data that was previously left on my screen.

--
Chuck F (cb********@yah oo.com) (cb********@wor ldnet.att.net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home .att.net> USE worldnet address!

Nov 13 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
105788
by: Dave | last post by:
Hi, I have done some research, trying to Clear The Screen in java code. The first option was the obv: system.out.print("\n\n\n\n\n\n\n\n\n\n\n\n"); then i heard about this method: System.out.print((char)27 + "[2J");
8
1621
by: Kris Dugan | last post by:
I am using a Unix/Solaris 8/9 environment. I want to make a tool that will constantly read a structure of information and display that information (or "paint it") to the screen. Rather than having the information scroll by, I want a way in which the screen would be "repainted". Sample Screen: ------------------------------------------------- | foo: 6 bar: 12 | | this: 18 that: 20 |
2
6192
by: Martín Marconcini | last post by:
Hello there, I'm writting (or trying to) a Console Application in C#. I has to be console. I remember back in the old days of Cobol (Unisys), Clipper and even Basic, I used to use a program (its name i cannot recall now...) where I designed the "screen" using this "program" and then saved it into an ASCII file. (thus, using 'extended' ASCII's like Lines, Corners, etc. and making screens look nicer and more professional). Then reading a...
3
3410
by: thelaery | last post by:
Hi, I'm trying to read the belgium eid card which gives out utf8, i can convert it to ansi but now i have the problem of converting the special chart to oem. utf8 to ansi for(x=0;x<lengte;x++){ if((SubPart&0x80)==0) printf("%c",SubPart); else{ unsigned char y;
0
3036
by: MaartenVR | last post by:
sub: MS SQL server and (missing) ANSI DATE-datatype I’m working at a company who has developed a large client/server application in Delphi 6, with Interbase as the DB-server (both Borland products). As data-access technology we use dbExpress (from Borland) because it is claimed to be database-independent. Now we have a new customer who wants to use MS SQL-server and I investigated if this was possible. Unfortunately my conclusion is that it...
65
8576
by: Leslie Kis-Adam | last post by:
Hi everyone! Does anyone know, if it is possible to clear the screen in ANSI C? If it is,then how? Any help would be appreciated. Laszlo Kis-Adam <dfighter_AT-NOSPAM_freemail.hu
1
2025
by: wschlanger | last post by:
Hi, the following code behaves differently for GCC/MSC and Borland C++ 5.6. The question was, what order does symbol lookup happen in? 1. declared symbols, including using'd symbols. 2. parent namespace (nested) 3. using'd namespaces. The above order is used by GCC and MSC, but Borland C++ 5.6 has (2)
0
7886
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8272
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8258
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6688
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5847
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5431
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3886
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2404
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1238
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.