Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Sep 8th, 2007, 2:45 PM   #1
peaceofpi
hi: for(;;) goto hi;
 
peaceofpi's Avatar
 
Join Date: Jun 2006
Posts: 93
Rep Power: 3 peaceofpi is on a distinguished road
Send a message via AIM to peaceofpi Send a message via MSN to peaceofpi
Portable alternative to system("cls");?

My current work (learning without a teacher/class means I have to pick a new topic and play with it till I get it) is a regular old console app with 900+ lines of source, not including the header file. I could probably split it up into different files, but that's not the issue here.

This thing has to clear the screen a lot, because a menu is shown after anything you do. So far, as far as I know, anything I've written prior to this will run on any platform you throw it at. But now, however, I can't find something to clear the screen that isn't related to windows, all I know right now are system("cls"); and a win32 API call (which is obviously way over my head).

Side question: Can anyone recommend a command line compiler that produces smaller executables? Right now I'm using g++ that came with Dev-Cpp, and the output is usually about 400kb bigger than the MSVS counterpart.
__________________
How do you play Religious Roulette?
Stand around in a circle and blaspheme till someone gets struck by lightning.
peaceofpi is offline   Reply With Quote
Old Sep 8th, 2007, 3:03 PM   #2
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
There is no portable way to clear the screen. Why? Because the type of screen you have varies from system to system. Some systems might not even have a screen. Some might have a teletype. C/C++ does not deal with those things. A particular system's implementation of C/C++ may provide proprietary extensions to deal with those things.

The nearest thing I can think of as a 'portable' way to clear the screen is to feed a lot of newlines. This will, of course, leave the prompt at the bottom. Works on a teletype, too, though .

If you find MS better than Dev-Cpp (minGW), why don't you use it? The debugger is far better, too.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Sep 8th, 2007, 3:42 PM   #3
peaceofpi
hi: for(;;) goto hi;
 
peaceofpi's Avatar
 
Join Date: Jun 2006
Posts: 93
Rep Power: 3 peaceofpi is on a distinguished road
Send a message via AIM to peaceofpi Send a message via MSN to peaceofpi
Well, that's no fun.

About the last part: I don't really have a preference, I like using g++ since I don't have to open any kind of IDE to do it. I suppose I could download VC++ express and borrow cl.exe with honor, though.
__________________
How do you play Religious Roulette?
Stand around in a circle and blaspheme till someone gets struck by lightning.
peaceofpi is offline   Reply With Quote
Old Sep 8th, 2007, 8:14 PM   #4
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
VC++ is perfectly suitable for command line operations.

You seem to be of the opinion that IDEs are not used by "real men". Welcome to the world of driving nails with a high-heeled shoe. IDEs are tools. People who refuse to use a hammer because high-heeled shoes are manly, are fools.

Your "honor" is not honor, it's stupidity. I'll wager that I can run rings around you in a command-line environment. There were no alternatives when I learned this shit.

With your attitude, I would fire you in a New York second, if someone had slipped up and hired you to begin with.

Tough words. Hope you don't ever get a reasonably intelligent and technically competent boss.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Sep 8th, 2007, 9:48 PM   #5
peaceofpi
hi: for(;;) goto hi;
 
peaceofpi's Avatar
 
Join Date: Jun 2006
Posts: 93
Rep Power: 3 peaceofpi is on a distinguished road
Send a message via AIM to peaceofpi Send a message via MSN to peaceofpi
er..

1. "borrowing with honor" is a funny way some people say "stealing" (probably misused here since I did the same with g++, and didn't know you could go without installing VC++'s IDE in the first place)
2. The reason I'm avoiding using an IDE is cause right now I'm on a computer that's pretty clunky, I don't want to waste any more system resources than I have to. At my own computer, I tend to use IDEs because they make life easier

Guess I'll spare no details in any future posts, I didn't think I came off as an asshole.
__________________
How do you play Religious Roulette?
Stand around in a circle and blaspheme till someone gets struck by lightning.
peaceofpi is offline   Reply With Quote
Old Sep 10th, 2007, 3:04 AM   #6
rwm
Professional Programmer
 
Join Date: Jan 2007
Location: Cape Town
Posts: 291
Rep Power: 2 rwm is on a distinguished road
Wow, people seem pretty hostile as of late!
rwm is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Alternative to Frames kruptof HTML / XHTML / CSS 6 Jun 11th, 2007 4:36 PM
memcpy alternative for arm-elf-gcc kurt C 6 Nov 29th, 2005 5:53 AM
Portable Firefox OpenLoop Other Programming Languages 8 Nov 23rd, 2005 12:36 AM
Portable Document Format qash Project Ideas 3 Sep 10th, 2005 6:34 PM
alternative compression algorithm Tor Other Programming Languages 10 Sep 1st, 2005 8:57 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 3:26 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC