hey,
i am, sorry for just asking now.......:(

Recommended Answers

All 28 Replies

Here's another link that may interest you.

Here's another link that may interest you.

if you include "stdlib.h"
and add the line

system("cls");

where you want to clear the screen, maybe it helps

I use it in Visual C++

>system("cls");
Brilliant. So what happens if I replace the Windows cls with my own malicious cls? You've just given me control, thanks! This is what's called a back door, and you left it wide open by using an insecure technique.

>system("cls");
Brilliant. So what happens if I replace the Windows cls with my own malicious cls? You've just given me control, thanks! This is what's called a back door, and you left it wide open by using an insecure technique.

right,
It is a system call, but as I know, borland's clrscr calls the system call inside?

>but as I know, borland's clrscr calls the system call inside?
Huh? I don't know what you're trying to say, but it's probably wrong and certainly doesn't make much sense.

>system("cls");
Brilliant. So what happens if I replace the Windows cls with my own malicious cls? You've just given me control, thanks! This is what's called a back door, and you left it wide open by using an insecure technique.

Only because the people at redmond are morons and designed permission and accounts in the worst way possible.

>Only because the people at redmond are morons and designed permission
>and accounts in the worst way possible.
Only bad programmers blame sloppy code on the environment. Good programmers write good code in spite of the environment.

you have critized using system() . Do you have a alternative? Do you expect programmers to just use?

for(int c=0; c<n; c++)
cout<<"\n";

Or you could get a better environment (use linux OR VMware to code! Its a great Idea!)

>you have critized using system()
How observant of you. I criticize a lot of things, and I'm usually right.

>Do you have a alternative?
Why yes, I do. My favorite alternative is not to clear the screen in the first place. There are so many reasons not to do it, and they all make more sense than the reasons to do it.

>Do you expect programmers to just use?
If it makes sense, sure. Though since system is nonportable anyway, why not use a far superior nonportable solution? Or better yet, since you want so much control over the console, use a console graphics library, or better yet, a full graphics API.

>Or you could get a better environment (use linux OR VMware to code! Its a great Idea!)
Better is subjective. You'll note that I didn't agree with you about the design of Windows. I simply said that I think you're a bad programmer and stated one of the two most obvious reasons.

Only because the people at redmond are morons and designed permission and accounts in the worst way possible.

I just give a way that anyone can use that function (system call)
but that does not mean that I use it, and the quality of my expertise.

Anyone asked if there is a way, and I offered a way.
no need to blame on anyone in my opinion.

happy codings...

in turboC++

clrscr();

Well, depending on the Operating System, the easiest way IS to make a system call.

system("clear");

I use this when developing Character based User Interfaces on UNIX as well as LINUX.

The same will work in PERL.

There is no need to create a screen clearing algorithm character by character, unless you into that kind of pain.....;)

here...this always works...I use it

void clearscreen()
{
int x = 1; 
int y = 100; 
do 
{ 
printf("\n"); 
x++; 
} 
while( x < y );
}

>How observant of you. I criticize a lot of things, and I'm usually right.

>I simply said that I think you're a bad programmer and stated one of the two most obvious reasons.

omg, /bow in the presence of Narue the almighty nerd...


loser.

>Well, depending on the Operating System, the easiest way IS to make a system call.
"Easiest" and "best" are often different.

>There is no need to create a screen clearing algorithm character by
>character, unless you into that kind of pain.....
Agreed.

>here...this always works...I use it
It doesn't really clear the screen though, it just scrolls away the visible lines. Even then it might not work if the vertical size exceeds 99 lines. Also, the cursor is going to be at the bottom of the screen as opposed to the top of the screen where it would be expected. Finally, there might not even be a screen. What happens if you redirect your program to a file? Oh, right, you can't because clearing the screen makes your program unsuitable for redirecting or piping. You've destroyed any chance of your program being a good filter. Nice job!

>loser.
Oh my, it's a good thing I don't care what some faceless forum goer says or thinks about me. There are a handful of people who's opinions I value, and you're not one of them.

>Well, depending on the Operating System, the easiest way IS to make a system call.
"Easiest" and "best" are often different.

>There is no need to create a screen clearing algorithm character by
>character, unless you into that kind of pain.....
Agreed.

>here...this always works...I use it
It doesn't really clear the screen though, it just scrolls away the visible lines. Even then it might not work if the vertical size exceeds 99 lines. Also, the cursor is going to be at the bottom of the screen as opposed to the top of the screen where it would be expected. Finally, there might not even be a screen. What happens if you redirect your program to a file? Oh, right, you can't because clearing the screen makes your program unsuitable for redirecting or piping. You've destroyed any chance of your program being a good filter. Nice job!

>loser.
Oh my, it's a good thing I don't care what some faceless forum goer says or thinks about me. There are a handful of people who's opinions I value, and you're not one of them.

It seems that YOU have an issue with differences of YOUR opinion. If you were paying attention, UNIX is what I said I use this on within C-Character Based User Interfaces. I saw the references to system and as I stated before, it works for me. Additionally, dependant upon how the function is set-up, it WILL send the cursor to position 0,0 on your screen.

And your issue with "...clearing the screen will make you program unsuitable for piping or redirection..." It would seem that I WANT TO CLEAR THE SCREEN, or perhaps you are limited in your understanding of how this works in the first place.

Now, with that said, I am not going to get into a "HISSY" with you, because quite frankly, I enjoy getting and submitting topics on this site, as I am "Light Years" ahead of you, both technically and professionally your "spewings" are amusing.

So, with that said, you may continue your rants. It is a shame however, that you waste your talent on being so critical to others.

>Do you have a alternative?
Why yes, I do. My favorite alternative is not to clear the screen in the first place. There are so many reasons not to do it, and they all make more sense than the reasons to do it.

Thats not an alternative. Thats not doing it. In some situations you should clear the screen. If you NEVER needed to clear the screen then why do ALL OSes come with CLEAR or CLS?

Apparently you think you are better then the UNIX system creators.

>Or you could get a better environment (use linux OR VMware to code! Its a great Idea!)
Better is subjective. You'll note that I didn't agree with you about the design of Windows. I simply said that I think you're a bad programmer and stated one of the two most obvious reasons.

You think I AM a bad programmer? I never use system() anyway. _I_ never said I used it. I just said that it has its uses, if it didn't then it wouldn't be in c/c++ would it? How about people you write shell scripts? All shell scripts use system calls. Do you think that they are all bad programmers to? That sounds awfully arrogant of you.

>system("cls");
Brilliant. So what happens if I replace the Windows cls with my own malicious cls? You've just given me control, thanks! This is what's called a back door, and you left it wide open by using an insecure technique.

WOW! What if someone replaced "SDL.h" with there own malicious header file! I really need to watch out for that!

I closed this thread becuse it has become a pissing contest.

i use clrscr(); to clear the screen but anyone knows how to clear the screen in any particular area

i use clrscr(); to clear the screen but anyone knows how to clear the screen in any particular area

If you need that kind of control you should be using a console graphics library, or better yet, a full graphical application rather than the console.

If you are using Turbo C then you can call assembly int 10H, set up the registers with screen coordinates then call int 10H. I used that often in MS-DOS 6.X but don't know if it still works in MS-Windows console screeen.

Since The Dragon closed this thread 5 years ago, I'll close it now.

I wonder how it got re-opened? Looks like closing threads doesn't work.

The closed status just didn't get migrated properly to the new system. I'm not convinced that it needs to be relocked anyway, given that the argument is over 5 years old and the participants are no longer active.

I'm not convinced that it needs to be relocked anyway, given that the argument is over 5 years old and the participants are no longer active.

After 7 new messages, none of which are helpful, you can say that? OK, point learned.

After 7 new messages, none of which are helpful, you can say that?

The first three of those are a question and two answers (which may be helpful), and the rest were prompted by your comment about closing the thread. Hmm... ;)

I'm glad it's closed.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.