clear screen for Linux 
Author Message
 clear screen for Linux

Quote:
> MSDOS, of course, has such a tool as well, "cls".

Yes, but what he was asking in the first place is, is there a C function to
clear the screen/output window?

I know that I would find it useful. There are a number of places WITHIN my
programs that could use a screen clear.

This thread seems to have drifted a little!!

Tom



Wed, 07 Sep 2005 04:54:44 GMT  
 clear screen for Linux


Quote:
>> MSDOS, of course, has such a tool as well, "cls".

> Yes, but what he was asking in the first place is, is there a C function
> to clear the screen/output window?

No. There is no screen in C.

Quote:
> I know that I would find it useful. There are a number of places WITHIN
> my programs that could use a screen clear.

The best you can do is try system("clear"); and hope your OS supports it.


Wed, 07 Sep 2005 04:56:04 GMT  
 clear screen for Linux

Quote:
> [snips]



> > Anyway, that is not my question.  I am not, for the moment, arguing
> > that various programs "should not" clear the screen (nor that they
> > should).  I am taking a neutral stance -- that was why I began that
> > paragraph with "seriously" -- and merely asking a question.

> Alright... let's go with that.

> > For instance, suppose I were to write the following C program:

> [surgical strike]

> >     void usage(void) {
> >         fprintf(stderr, "usage: uarith <number> <op> <number>\n"
> >             "\twhere <number> is an integer and <op> is one of + - .
/\n"
> >             "\tfor addition, subtraction, multiplication, and
> division\n");
> >         exit(EXIT_FAILURE);
> >     }

> >     int main(int argc, char **argv) {
> >         unsigned long v1, v2, r;
> >         char op, *ep;

> >         if (argc < 4)
> >             usage();
> ...
> >         printf("%lu %c %lu = %lu\n", v1, op, v2, r);
> >         return 0;
> >     }

> > Now, *I* would write this program just as I did -- without any
> > attempt at screen clearing.  I prefer it that way (for various
> > reasons, some or all of which you -- Kelsey Bjarnason -- seem to
> > reject, but it remains my personal preference).

> Fine, great, marvellous.

> > Apparently some
> > other people would insert a "clear the screen" operation before
> > the first test on argc.

> Or, at the least, before "real" output is done.

> >  Being a curious fellow, I want to know
> > why.  For those who *do* prefer, for whatever reasons, to have this
> > program clear the screen, what *are* those reasons?

> How about the obvious: WYSIWYG.  What's on your screen is the result of
the
> current program, rather than the historical dregs of a mess of other
> programs which [said dregs] you don't care about?

> Some folks don't "get" why GUIs are so popular.  Watching granddad look
over
> a screen gives a good hint; he reads *everything* from top to bottom until
> he finds what he's looking for.  As a result, he absolutely despises
> command-line applications, because 90% or more don't clear the screen -
that
> error message there, was that from *this* program run, or from 4 hours
ago?
> With a GUI app, he at least knows that "the screen" he needs to be
concerned
> with is the application's window - and it has nothing but the current
state
> of the application (and/or app data) for him to look at; no such question
> about the error message, no need to read everything, no, just *zot* and
> there's your data - and nothing but your data.  We can't (quite) achieve
the
> same capability in text mode, but we can come close: we can clear the
> screen.

My opinion on the whole thing is that, if you are taking data from the
command line that the user types from the output of another program, then
the whole debate on clear screening is irrelevant because you've just used
that data.
Also the screen was never intended as a storage device (Well that's not
technically true because computers from the Manchester Mark 1 (1948) to the
IBM 701 (1952) used Williams Tube memory which simply stored charge on a
CRT.) just as a display device giving data to the user.

Quote:
> Now, for a techno-weenie, screen clears may be a bugaboo; they _want_ a
> historical archive of all they've done.  Then again, they can deal, almost
> instantly, with reams of data, error codes and the like, since they know
> that "new" data starts "oh, about here"; no need for them to re-read the
> entire screen and ponder that error message they dealt with 2 hours ago.
> Thing is, techno-weenies are not the only users of such machines and, I'd
> argue, aren't even the majority.

> So, when designing a console app, should I implement for the technically
> savvy minority?  Or the less technical majority?  Or, for that matter,
even
> if the less technical types are in fact a minority, why not design so they
> can cope easily anyhow, since the tech types can quite handily pipe, log,
or
> otherwise manage things?

Well, you simply design for the percieved user

Quote:
> > I have given
> > my reasons for my preference (increased portability, less effort
> > expended in writing the initial program, and having less text
> > disappear from the screen or window in which I run the program);
> > now I want you to give yours.

> See above.  While seeing above, ponder why people despise top-posting so.
> Hint: it has nothing to do with the text itself; the text doesn't change.
> Rather, it's because one is forced to wade through the text to see what
goes
> where, what belongs to what - exactly the problem granddad has with apps
> that don't clear the screen.

I agree with that!!


Thu, 08 Sep 2005 02:18:29 GMT  
 clear screen for Linux

Quote:




Quote:

> <snip>

> > > Well, it appears the troll has come full circle.  Very mystical, and
> > > all that.

> > Also note that this is the only response to which the OP was polite.
I've
> > never seen so many plonks in so short a time. For the record, are there
any
> > clued regulars who haven't plonked the OP?

> Clued, I don't know about. Plonked? No, I haven't plonked the guy yet.
> I'm still hoping he can be saved.

Plonked?
I've been on newsgroups for ages but I haven't heard of that expression.
Can someone tell me what it means? Is it similar to killfiling?

Tom



Thu, 08 Sep 2005 09:13:32 GMT  
 clear screen for Linux

Quote:


> > >> * Paul Lehmann
> > >> | I think a lot of you have missed somethng.
> > >> | My original post was how to clear the screen in LINUX.

> > > I think you missed something yourself. Namely the entire point of this
> > > newsgroup. We don't deal with issues in LINUX here. Nor do we deal
with
> > > issues in WINDOWS, SOLARIS, MACOS, or any specific operating system.
> > > This newsgroup is only for those aspects of C that have been
> > > standardised by ISO and are guaranteed to work everywhere.

> > Then I suggest the newsgroup be renamed to something like ISO C or some
> > other title that lets users know

> Why? Is not the name "comp.lang.c" sufficient to indicate that this
> newsgroup is for discussing a computer language called C?

Yes
That's what he IS talking about. He is talking about the use of the C
language.
What I seem to be hearing from a few posters is that this newsgroup is
strictly ONLY for the {*filter*}discussion of the standardisation of C.
The name of the newsgroup gives the impression that it's for the discussion
of programming with C, after all what else are you going to do with C apart
from programming with it?

Tom



Thu, 08 Sep 2005 09:27:44 GMT  
 clear screen for Linux

Quote:






Quote:

> > <snip>

> > > > Well, it appears the troll has come full circle.  Very mystical, and
> > > > all that.

> > > Also note that this is the only response to which the OP was polite.
> I've
> > > never seen so many plonks in so short a time. For the record, are
there
> any
> > > clued regulars who haven't plonked the OP?

> > Clued, I don't know about. Plonked? No, I haven't plonked the guy yet.
> > I'm still hoping he can be saved.

> Plonked?
> I've been on newsgroups for ages but I haven't heard of that expression.

Then sentence above is good example of oxymoron.

Quote:
> Can someone tell me what it means? Is it similar to killfiling?

FYI: http://plonk.sourceforge.net/ (1st English hit for plonk usenet)
I'm tempted to ask if you ever heard of google.
But I'm not going to. I'm not regular and wasn't
here "for ages". And I don't want to get plonked.


Thu, 08 Sep 2005 09:34:22 GMT  
 clear screen for Linux

Quote:





>> > >> * Paul Lehmann
>> > >> | I think a lot of you have missed somethng.
>> > >> | My original post was how to clear the screen in LINUX.

>> > > I think you missed something yourself. Namely the entire point of this
>> > > newsgroup. We don't deal with issues in LINUX here. Nor do we deal
> with
>> > > issues in WINDOWS, SOLARIS, MACOS, or any specific operating system.
>> > > This newsgroup is only for those aspects of C that have been
>> > > standardised by ISO and are guaranteed to work everywhere.

>> > Then I suggest the newsgroup be renamed to something like ISO C or some
>> > other title that lets users know

>> Why? Is not the name "comp.lang.c" sufficient to indicate that this
>> newsgroup is for discussing a computer language called C?

> Yes
> That's what he IS talking about. He is talking about the use of the C
> language.

No, he's asking a question about programming for linux, not programming
in C.  There are specific groups for this - I suggest
comp.os.linux.development.apps.

        - Kevin.



Thu, 08 Sep 2005 10:55:44 GMT  
 clear screen for Linux

Quote:

> > MSDOS, of course, has such a tool as well, "cls".

> Yes, but what he was asking in the first place is,

 > "Is there a C function to clear the screen/output window?"

No.

Quote:
> I know that I would find it useful.

 > There are a number of places WITHIN my programs
 > that could use a screen clear.

        void cls(void) {
          system("clear");
          }

might work on a UNIX system
but you really should consult one of the usenet newsgroups
specific to your operating system for such advice.



Thu, 08 Sep 2005 11:13:32 GMT  
 clear screen for Linux

Hmmm. This must have been written months ago. I wonder if Usenet is on the
blink again?

<snip>

Quote:
>> > Then I suggest the newsgroup be renamed to something like ISO C or some
>> > other title that lets users know

>> Why? Is not the name "comp.lang.c" sufficient to indicate that this
>> newsgroup is for discussing a computer language called C?

> Yes
> That's what he IS talking about. He is talking about the use of the C
> language.

The OP? No, he was talking about clearing the screen in Linux. That's an
implementation issue.

Quote:
> What I seem to be hearing from a few posters is that this newsgroup is
> strictly ONLY for the {*filter*}discussion of the standardisation of C.

No, it's for discussing programming in standard C. You are thinking of
comp.std.c, I think.

Quote:
> The name of the newsgroup gives the impression that it's for the
> discussion of programming with C, after all what else are you going to do
> with C apart from programming with it?

Quite. But clearing the screen is not one of those things that the C
language covers. You have to use extensions, and there are lots of
newsgroups for discussing those.

--

"Usenet is a strange place." - Dennis M Ritchie, 29 July 1999.
C FAQ: http://www.*-*-*.com/ ~scs/C-faq/top.html
K&R answers, C books, etc: http://www.*-*-*.com/



Thu, 08 Sep 2005 17:21:07 GMT  
 clear screen for Linux

Quote:




[snip]
>>Clued, I don't know about. Plonked? No, I haven't plonked the guy yet.
>>I'm still hoping he can be saved.

> Plonked?
> I've been on newsgroups for ages but I haven't heard of that expression.
> Can someone tell me what it means? Is it similar to killfiling?

"Plonk" is the sound a poster makes when they hit the bottom of the
killfile.

--
Lew Pitcher

Master Codewright and JOAT-in-training
Registered Linux User #112576 (http://counter.li.org/)
Slackware - Because I know what I'm doing.



Fri, 09 Sep 2005 09:33:08 GMT  
 
 [ 10 post ] 

 Relevant Pages 

1. clear screen for Linux

2. GNU/Linux clear screen

3. Clearing the screen in Unix/Linux

4. Init Screen w/o Clear Screen

5. Clearing screen before displaying menu

6. clearing screen

7. Clear Screen

8. ANSI clear screen

9. Help clearing screen

10. clearing the screen

11. Clear screen and cursor-position

12. Clear screen

 

 
Powered by phpBB® Forum Software