Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Alternative for getch(), delay() / sleep (), clrscr(), others

Alternative for getch(), delay() / sleep (), clrscr(), others
Thread Tools
Senior User
Join Date: Nov 1999
Location: Milkyway Galaxy
Status: Offline
Reply With Quote
Dec 27, 2001, 01:01 AM
 
Hello,
I am taking a comp.prog into'd cource and we use Borland Turbo C++ 3.0 for DOS on WinTel machines (Dells...::UKE:: . With this, we are learning C++ by writing relatively mediocre text-only / command-line only DOS programs. However, several commands do not work at home in PB Version 1.1.1 (December 2001 Developer Tools). I know the reason why they don't work. The function that I use in my programs but don't with with GCC at home include (so far):

clrscr(); --- clears the screen (console)
getch(); -- wait for user to press any key
delay() / sleep() --- pauses the program for a specified time amount
gotoxy(x,y) --- sets text cursor to those coordinates on the console

The reason their don't work is because those calls are definated in the "conio.h" and "dos.h" header files, which are present in Turbo C++ on DOS but not GCC 2.xx.x on Mac OS X.

What alternatives can I use to accomplish those simple console task (clear the screen, for example) ? Since Mac OS X has its own
>console mode, t heir must be some equivalent commands to do those actions -- not everything is a GUI program.


thanks a bunch for any advice.
Death To Extremists!
     
Senior User
Join Date: Sep 2000
Location: Boston, MA
Status: Offline
Reply With Quote
Dec 27, 2001, 01:18 PM
 
all that is in the curses library. That is included in OSX.

Or you can grab ncurses from www.gnu.org
     
   
Thread Tools
Forum Links
Forum 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
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 01:24 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2