screen clearing in ANSI C

R

Richard Heathfield

Ben Pfaff said:
This is exactly why off-topic questions should not receive
answers: often, the given "answers" are wrong.

The question is not off-topic, and there is a perfectly topical answer to
the perfectly topical question. That perfectly topical answer is "no".
 
R

Richard Bos

Chris Hills said:
If yopu have a screen you will need to clear it at some point.

Sorry, but that's complete nonsense. Some screens (e.g., dumb terminals)
_cannot_ even be cleared.
You have to use the escape codes for that VT

That, too, is nonsense. It's just one option, and it works far from
everywhere.

Richard
 
M

Mark McIntyre

Non-sequitur: even if the question were on-topic, there is no guarantee I
would have answered it correctly.

But had you been wrong about something topical, there would be plenty
of people here who could correct you. With an offtopic reply, you may
be utterly wrong, and yet go quite uncorrected.
Additionally, my answer is "right". The short program will clear the screen
using Putty and probably also using SSH Secure Shell.

Its worth noting that finding examples which happen to agree with you
does *not* constitute a proof. Here's a case in point: I assert that
all inhabitants of my town are named mcintyre. Evidence: all the ones
I can see are named mcintyre. QEND.
I'm not sure there is a single method that will clear the screen on all
platforms.

There isn't. This is a FAQ by the way.
--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
 
M

Mark McIntyre

I'm amazed. I see 57 articles in this thread. Only one mentions that
this is a FAQ, and that one didn't say which one.

What, we have to find the /number/ of the FAQ for people too?

Sheesh, why don't we get them a cold beer and sandwich while we're at
it?
--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
 
D

Default User

Mark said:
What, we have to find the number of the FAQ for people too?

Sheesh, why don't we get them a cold beer and sandwich while we're at
it?


Hook me up, Slim.




Brian
 
L

Leslie Kis-Adam

Keith said:
I'm amazed. I see 57 articles in this thread. Only one mentions that
this is a FAQ, and that one didn't say which one.

We have a very good FAQ list for this newsgroup. We should use it,
rather than reinventing the wheel. (And if we must reinvent the
wheel, can we at least make it round?)

The comp.lang.c FAQ is at <http://www.c-faq.com/>. You have asked
question 19.4.

I have a couple of comments on top of that.

The FAQ overstates the portability of using a form-feed character,
'\f', to clear a screen; it doesn't work on most of the terminal
emulators I use.

Consider carefully whether you really need to clear the screen at all.
You'll be erasing information belonging to whomever is using your
program, information that is probably on the screen for a very good
reason. There are good reasons for clearing the screen, but be sure
you actually have a good reason before you do it. (If your program
needs to control the entire screen, like a text editor, you'll need
something much more sophisticated than a control sequence or simple
external program; the details are equally off-topic.)
Thanks for posting the existense, and location of the faq. I wanted to
clear the screen for a portable character based go-moku game, but I
found out, that I don't really need it, so decided not to clear. Anyway,
thanks for all help.

--
Leslie Kis-Adam or
Laszlo Kis-Adam or even
Kis-Ádám László

Student
Budapest University of Technology and Economics
Faculty of Electronic Engineering and Computer Science
<dfighter_AT_NOSPAM_freemail.hu>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,573
Members
45,046
Latest member
Gavizuho

Latest Threads

Top