-
cls() vs system("cls")
I am wondering why devC++ will only take system("cls") to clear the screen and not cld() function. Is it part of the borland functions? Because I downladed a source from planetsourcecode.com and in the example I compiled it seemed to accept it. But when I tryed it out on my own it said:
ERROR: 'cls' undelcared first use of this function
I am thinking perhaps the code I had was created on a different IDE/compiler setup to the one I have.
The point of all this, is I want to use somthing else from system("cls") as I know it can leed to security leaks in code.
I have read the FAQ on this and most of them do not work on my IDE
-
> I have read the FAQ on this and most of them do not work on my IDE
Choose one of the ways that do. The answer to that question is pretty thorough.
-
>Because I downladed a source from planetsourcecode.com
Just FYI, but the quality of implementation on planetsourcecode tends to be skewed toward the crap end of the spectrum.
>and in the example I compiled it seemed to accept it.
You compiled it with Dev-C++? Did the code you downloaded implement such a function?
>I am thinking perhaps the code I had was created on a different IDE/compiler setup to the one I have.
If it was and used non-portable extensions, your compiler would probably fail to compile it.
>I have read the FAQ on this and most of them do not work on my IDE
My usual advice is to stop wasting your time on such silly things. Clearing the screen in a console mode program is a frivolous and often unnecessary feature in a well designed program.
>I have read the FAQ on this and most of them do not work on my IDE
You said you have Dev-C++, right? Let's see:
Option 1: Dev-C++ supports clrscr
Option 2: Barring no way to figure out the exact height of the screen, this solution will work everywhere.
Option 3: Curses are readily available
Option 4: This won't work.
Option 5: I fail to see how your compiler affects this.
Option 6: This will work on Dev-C++.
WINDOWS CONSOLE OPTION: Dev-C++ supports the Win32 API.
So out of seven options, only one will not work on your IDE. That hardly justifies your use of "most of them", and it suggests that you're simply being lazy.
-
Even Borland doesn't have a cls() function as far as I know, only clrscr(). cls() must have been something in the example itself.
-
Thanks prelude for your advise. But can I point out that I am rather insulted by your recomendation that I am being lazy. I was only asking if anyone can help me out with a problem and I am very greatful that you suggested helping me but I prefer not to be called incompetant. DevC++ is a dead project nowdays as I am sure you know anyway so I was having difficulty in finding the answer I was looking for.
I like this forum and find the help I get and get to give is all part of the learning process. But calling sombody lazy who was just seeking help is just not on
-
>But can I point out that I am rather insulted by your recomendation that I am being lazy.
You'll get over it.
>I prefer not to be called incompetant.
I didn't call you incompetent. I called you lazy. Actually, I didn't call you anything. I simply commented on how your question suggests that you're lazy. I came to that conclusion based on my experience with Dev-C++ (and how all but one of the options work just fine), and the extremely short time it took me to grab the two links I provided. I'm not exceptionally smart, so I think it's safe to assume that if you couldn't get any of the options to work to your satisfaction, or find any alternatives, you're simply being lazy. I call it like I see it. Deal.
-
Ok then. i am not going to argue this any further. As you said, you told it as you saw it. It proves I am an idiot and did not think more carefully about how I worded my question. I do aplogise for that, I you have made this clear that in the future I think more of what I type and read and learn more before I post a thread