home *** CD-ROM | disk | FTP | other *** search
- Path: luck.shnet.org!postmaster
- Newsgroups: comp.sys.amiga.programmer
- References: <Pine.HPP.3.91-941213.960103232026.2289A-100000@pahang.dur.ac.uk>
- From: "Christian Pekeler" <pekeler@luck.shnet.org>
- Date: Thu, 04 Jan 96 10:27:41 +0100
- MIME-Version: 1.0
- Content-Type: text/plain; charset=iso-8859-1
- Content-Transfer-Encoding: 8bit
- Subject: Re: Amiga equiv of conio.h
- Message-ID: <29790985@luck.shnet.org>
-
- Nick Pratt:
- > Ok, Ive been programming on a PC for some company, and Ive relied quite
- > heavily on the functions in conio.h(Turbo C++, V3.0), and I was
- > wondering if anyone has any equivalent amiga functions for this library,
- > such as gotoxy(x,y), clreol(x,y) (clear to end of line from pt x,y) etc.
-
- This dirty hack worked for me in g++, maybe it will help you as
- a basis for other funktions of conio...
-
- my_conio.h----------------------CUT----------------------------------
- // my conio.h, Christian Pekeler, 23.5.95
-
- #ifndef _my_conio_h
- #define _my_conio_h
-
- void clreol();
- void clrscr();
- void gotoxy(int x, int y);
- char getch();
- char getche();
- int kbhit();
- int putch(char c);
-
- #endif /* _my_conio_h */
- --------------------------------CUT----------------------------------
-
- my_conio.cpp--------------------CUT----------------------------------
- // my conio.cpp, Christian Pekeler, 23.5.95
-
- #include <clib/dos_protos.h>
- #include <iostream.h>
- #include "my_conio.h"
-
- #define scon SetMode(Output(), 0)
- #define sraw SetMode(Output(), 1)
-
- void clreol() {cout<<""; return;}
- void clrscr() {cout<<"H"<<""; return;}
- void gotoxy(int x, int y) {cout<<""<<y<<";"<<x<<"H"; return;}
- char getch() {sraw; char c; cin.get(c); scon; return c;}
- char getche() {sraw; char c; cin.get(c); cout<<c; scon; return c;}
- int kbhit() {sraw; char c; cin.get(c); scon; return 1;}
- int putch(char c) {cout<<c; return 1;}
-
- #undef scon
- #undef sraw
- --------------------------------CUT----------------------------------
-
- Hope the ESC-Codes make it through. Sorry, but can't remember where
- I've looked them up.
-
- Christian
-