delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/05/01/01:47:16

From: "John M. Aldrich" <fighteer AT cs DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: gotoxy() for UNIX
Date: Thu, 30 Apr 1998 22:41:07 -0400
Organization: Two pounds of chaos and a pinch of salt.
Lines: 37
Message-ID: <35493643.15C9@cs.com>
References: <3 DOT 0 DOT 5 DOT 32 DOT 19980430022205 DOT 007b09d0 AT 200 DOT 252 DOT 238 DOT 1>
<wanpsm98 DOT 893973216 AT octarine> <cpGG5hC00WB81C=lE0 AT andrew DOT cmu DOT edu>
NNTP-Posting-Host: ppp126.cs.net
Mime-Version: 1.0
CC: "Thiago F.G. Albuquerque" <thiagofga AT ambr DOT com DOT br>
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

James W Sager Iii wrote:
> 
> And I have had the same problem myself.  gotoxy doesn't
> work for DOS either.  I had to draw out letters, numbers,
> and symbols by hand then use allegro and some tactical blitting.

I think I should mention that gotoxy() does work properly; it's just
that in many cases, people make the silly mistake of writing code like
the following:

    printf( "Hello" );
    gotoxy( 10, 10 );
    printf( "World" );

And then they wonder why "Hello" and "World" get printed together.  The
solution is really simple; stdout is line-buffered in DJGPP.  It's
generally a bad idea to mix conio and stdio functions; what the
programmer in the example should have done is use cprintf().  See
chapter 9.4 of the FAQ for details.

To the original poster:  there is no generally accepted method of cursor
movement in a Unixy environment simply because there is no standard
hardware interface.  There are literally thousands of different kinds of
systems that run Unix, and writing a simple standard interface that
would work equally on all of them would be totally impossible. 
Therefore you have libraries like Curses and Xterm that are intended to
be cross-platform, but end up bulky and slow as a result.

hth!

-- 
---------------------------------------------------------------------
|      John M. Aldrich       | "Animals can be driven crazy by pla- |
|       aka Fighteer I       | cing too many in too small a pen.    |
|   mailto:fighteer AT cs DOT com   | Homo sapiens is the only animal that |
| http://www.cs.com/fighteer | voluntarily does this to himself."   |
---------------------------------------------------------------------

- Raw text -


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