delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/01/08/02:51:37

Message-Id: <199801080749.JAA05842@ankara.duzen.com.tr>
Comments: Authenticated sender is <mitch AT ankara DOT duzen DOT com DOT tr>
From: "S. M. Halloran" <mitch AT duzen DOT com DOT tr>
Organization: User RFC 822- and 1123-Compliant
To: djgpp AT delorie DOT com
Date: Thu, 8 Jan 1998 09:37:30 +0200
MIME-Version: 1.0
Subject: Re: Questions on Screen Controls
In-reply-to: <34B41878.BE05B46D@bethany.edu>

On  7 Jan 98, pneyz was found to have commented thusly:

> > Is there a list anywhere that explains how to do simple screen controls
> > with djgpp? I am currently using RHIDE with DJGPP attempting to expand
> > my limited C knoweledge. While I have learned that there are no basic
> > options for clearing the screen, changing it to blue etc... there has
> > got to be a way. My operating system is Win95/MS-Dos and I am not
> > playing with C++ at the moment just C. Any links would be greatly
> > appreciated that cover screen controls under DOS and DJGPP.

"...I am not playing with C++ at the moment just C"?  I am having 
this comment forwarded to the appropriate advocacy groups and, of 
course, you will probably be contacted by a representative. :)

> Look in conio.h at clrscr(), textcolor() and textbackground(). They will
> do the things you mentioned. Note that this is all textmode stuff, not
> any sort of hires mode. Try the below code for a little demonstration:

[code excised]

You are advised about the inherent lack of portability of these 
conio.h library functions, which I admit that I never liked too much. 
 The ANSI/ISO standards-setters don't much like discussion I/O, and 
it is amazing we have any functions at all in dealing with I/O.  I 
personally recommend using the curses library functions, and there is 
some public domain stuff.  The curses designers are responsible for 
making the proper links and hooks (making the proper system calls, 
perhaps even asking the kernel politely to do a machine interrupt) so 
that app programmers who want to write colorful apps with cursor 
control can do so.  Curses functions may even be POSIX-blessed now, 
and that is standard enough for me.  I have written my own 
still-incomplete-likely-buggy MS-DOS port of curses/menus/forms 
library functions as described in the man pages of Unix SysVR4
put out by USL, because I think it is a standard to which the 
portability people should look at.  (GNU won't touch it though, 
because for a few--okay, many--functions, I had to decompile the 
object code because USL had so badly documented the library functions 
in their man pages that looking at source was the only way to figure 
out what they were trying to do.)  It seems to be that Borland and 
Microsoft could have used curses functionality to mesh with the MSDOS 
and BIOS interrupt system, as I think curses pre-dates all those 
conio functions.

Of course, if you are of the opinion that every one of us wakes up 
first seeing and goes to bed last seeing Microsoft products and will 
do so for a few generations, then don't worry about portability and 
disregard everything I have just written.  (you may have anyway...:)

Mitch Halloran
Research (Bio)chemist
Duzen Laboratories Group
Ankara   TURKEY
mitch AT duzen DOT com DOT tr

other job title:  Sequoia's (dob 12-20-95) daddy

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019