User Name
Password

Go Back   Planetarion Forums > Non Planetarion Discussions > Programming and Discussion

Reply
Thread Tools Display Modes
Unread 2 Dec 2003, 18:01   #1
CaShY
Registered User
 
CaShY's Avatar
 
Join Date: Jul 2002
Location: uk
Posts: 50
CaShY is an unknown quantity at this point
Clear Screen in C

Anyone know how to do a clear screen function in C?

I have googled for hours today and come up with nothing that works
only stuff I can find, will only work with C++.

I am using msvc++ as the complier for my C work as that’s what college makes us use.


So any help will be very much appreciated
__________________
CaShY
CaShY is offline   Reply With Quote
Unread 2 Dec 2003, 20:36   #2
meglamaniac
Born Sinful
 
meglamaniac's Avatar
 
Join Date: Nov 2000
Location: Loughborough, UK
Posts: 4,059
meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.
Re: Clear Screen in C

Last time I did any screen clearing with C and used a function for it, it was back when I was programming in DOS.
The function used then (it was a Borland compiler, so this may not work if you're using MS C and it may be outdated anyway) was clrscr().

What I tend to do these days is just system("whatever the command to clear the screen is in the operating system i'm programming for");

Win32:
system("cls");

Linux:
system("clear");

etc...
__________________
Worth dying for. Worth killing for. Worth going to hell for. Amen.
meglamaniac is offline   Reply With Quote
Unread 3 Dec 2003, 08:12   #3
NEWSBOT3
NEWSBOT
 
Join Date: Dec 2000
Location: The enby cave!
Posts: 4,872
NEWSBOT3 needs a job and a girlfriendNEWSBOT3 needs a job and a girlfriendNEWSBOT3 needs a job and a girlfriendNEWSBOT3 needs a job and a girlfriendNEWSBOT3 needs a job and a girlfriendNEWSBOT3 needs a job and a girlfriendNEWSBOT3 needs a job and a girlfriendNEWSBOT3 needs a job and a girlfriendNEWSBOT3 needs a job and a girlfriendNEWSBOT3 needs a job and a girlfriendNEWSBOT3 needs a job and a girlfriend
Re: Clear Screen in C

clrscr rings a bell
if that doesnt work do cls thing
__________________
[20:27:47] <nodrog-aawy> **** i think my housemate just caught me masturbating
[11:25:32] <idimmu> you are a little piggy arent you
[13:17:00] <KaneED> i'm so closet i'm like narnia
__________________
Pretty parks and funky scrap metal things here
NEWSBOT3 is offline   Reply With Quote
Unread 3 Dec 2003, 11:31   #4
CaShY
Registered User
 
CaShY's Avatar
 
Join Date: Jul 2002
Location: uk
Posts: 50
CaShY is an unknown quantity at this point
Re: Clear Screen in C

ta meglamaniac
__________________
CaShY
CaShY is offline   Reply With Quote
Unread 4 Dec 2003, 01:53   #5
Gayle29uk
Bitch
 
Join Date: Jun 2002
Location: North Yorkshire
Posts: 3,848
Gayle29uk is just really niceGayle29uk is just really niceGayle29uk is just really niceGayle29uk is just really nice
Re: Clear Screen in C

clrscr() used to clear a text mode screen and clearscreen() cleared a graphical one. I still remember this because I spent 3 days trying to troubleshoot one of my university projects.

The assignment was to implement a system to take realtime data (simulated using a text file) and display it graphically with user configurable alert levels.

This was the basic Programming level 2 course (level 1 was Modula-2 (I still have nightmares)) and certainly not a problem for someone who already knew C years before right? HAH!

I was getting weird things going on, colours were not changing as they were meant to when the alert levels were crossed and I couldn't see any reason why. I tried every way possible in Borland C++ 3.1 to change those colours but they still did weird things. I couldn't find a bug in my code for love nor money, nor could my tutor. I even implemented my own ET4000 (my GFX card) colour mapping routine using TASM to programme the GFX card directly but got exactly the same results.

What was it? I had used clearscreen() to clear a text screen a bit earlier in my code. That's all it was and it took 3 days to find.

Now I remember why I like PHP so much
__________________
ACHTUNG!!!
Das machine is nicht fur gefingerpoken und mittengrabben. Ist easy
schnappen der springenwerk, blowenfusen und corkenpoppen mit
spitzensparken. Ist nicht fur gewerken by das dummkopfen. Das
rubbernecken sightseeren keepen hands in das pockets. Relaxen und vatch
das blinkenlights!!!
Gayle29uk is offline   Reply With Quote
Unread 4 Dec 2003, 13:09   #6
meglamaniac
Born Sinful
 
meglamaniac's Avatar
 
Join Date: Nov 2000
Location: Loughborough, UK
Posts: 4,059
meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.
Re: Clear Screen in C

Borland C++ did indeed have it's annoyances.

I remember trying to build a virtual memory type system for a game I was writing - somewhere I could dump the large ammounts of graphics I was using when I didn't need them, as I didn't have an extended memory driver at that point so was limited to 1Mb.

EVERYTHING I retrieved from it came back with whatever the ASCII number for a heart symbol is on the end of it. I tried for days to find out what was going on and couldn't do it for love nor money, so I rewrote the system exactly the same but by hand (I'd tried copying/pasting allready in desperation).
It worked.

I never have figured out what the hell was going on...
__________________
Worth dying for. Worth killing for. Worth going to hell for. Amen.
meglamaniac is offline   Reply With Quote
Unread 4 Dec 2003, 22:20   #7
Cyp
∞+♪²
 
Join Date: Nov 2000
Location: :uo!te]o¯|
Posts: 428
Cyp is an unknown quantity at this point
Re: Clear Screen in C

For clearing the screen in a specific colour, can use this:

glClearColor(1,.5,.25,1);
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
__________________
Structural Integrity for Creator - since he'll probably make PA turn 3D.
Wikipedia forum
Note to self - Don't write Chinese letters with bold and italics...
<!--Last incarnation: Nov 2000-->
Cyp is offline   Reply With Quote
Unread 4 Dec 2003, 22:45   #8
Intrepid00
Registered User
 
Join Date: Aug 2000
Posts: 1,967
Intrepid00 is an unknown quantity at this point
Re: Clear Screen in C

Quote:
Originally Posted by Gayle29uk
clrscr() used to clear a text mode screen and clearscreen() cleared a graphical one. I still remember this because I spent 3 days trying to troubleshoot one of my university projects.

The assignment was to implement a system to take realtime data (simulated using a text file) and display it graphically with user configurable alert levels.

This was the basic Programming level 2 course (level 1 was Modula-2 (I still have nightmares)) and certainly not a problem for someone who already knew C years before right? HAH!
So it is from Basic clrscr()? I kept thinking about it where I saw this command and why it was so familar and it hit me, Basic (Basic Basic) Elemantry Class.
Intrepid00 is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
The Sol War: 2065 Part II Inspectre Roleplaying 144 13 Jan 2004 11:03
Alliance Ranking Screen Kal Planetarion Discussions 13 9 Oct 2003 23:59
Can we just clear this up Supernova9 Alliance Discussions 21 13 Apr 2003 14:40
Is Screen a resource hog? Mong Hardware and Tech Support 5 9 Jan 2003 12:39
Dual-boot select screen SYMM Hardware and Tech Support 4 6 Dec 2002 16:18


All times are GMT +1. The time now is 12:26.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2002 - 2018