From: Tobias Ernst <tobi@bland.fido.de>
Subject: Re: Dec C pecularity
Date: 1999/06/26 [thread overview]
Message-ID: <87vhcb42lh.fsf@romulus.bland.fido.de> (raw)
In-Reply-To: 7k37t4$bq@web.nmti.com
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2261 bytes --]
peter@baileynm.com (Peter da Silva) writes:
> Since \033 (which you do know about) takes the same number of characters
> as \x1b, and has the advantage of actually being C rather than some
> extension, why not use that?
People tend to use \x1b instead of \033 because a little more advanced
programmers usually know hexadecimal codes by heart, while they have to
calculate the octal ones manually. I personally tend to like compilers that
understand \x.. because they give me less trouble when I take over code from
someone else that has been using \x... In my current code I changed all
occurences of hexadecimal codes to octal ones, but it was not the most
pleasant kind of work.
BTW, Jeff Sullivan has pointed out to me that DEC cc can handle \x... when
using the -std or -std1 option.
> cl = tgetstr(tbuf, "cl");
I know that this method is more clean in theory. It also works very well if
you restrict yourself on using simple things like clear screen and move the
cursor. However, I made the experiences that especially on countless Linux
installations, but also on some commercial boxes like AIX, tgetstr tells you
lot of very advanced commands that it thinks the terminal understands, which
actually the terminal doesn�t understand. The result is that text-based
applications that are written "more cleanly" in theory actually do not work
like the users expects.
Therefore, I decided for some procjects to ignore termcap and use the plain
ANSI X3.64 (ISO 6429) command set, or to be more exactly that subpart of it
that even runs on a VT52. This is not so clean in theory as it will not run
on some terminals that use totally different command strings, but in praxis
it will run better for most users.
Another reason I sometimes use these codes is that such programs can be
ported over to systems that do not have a termcap by default, like DOS,
Windows and OS/2, and will work instantly.
However this is not always an option; the subset that can sefely be used is
very small and not very powerful, so sometimes the program gets too slow
because it has to emulate advnanced functions with very basic commands. If
this becomes a problem I also resort to using termcap.
But I guess this is getting off-topic here ;-).
Kind Regards,
Tobias.
next prev parent reply other threads:[~1999-06-26 4:00 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-06-09 4:00 Dec C pecularity Bernhard Reiter
1999-06-11 4:00 ` Jeff Sullivan
1999-06-13 4:00 ` Tobias Ernst
1999-06-14 4:00 ` Peter da Silva
1999-06-26 4:00 ` Tobias Ernst [this message]
1999-06-29 4:00 ` Charles M Richmond
1999-07-13 4:00 ` Tobias Ernst
1999-07-13 4:00 ` Charles M Richmond
1999-07-13 4:00 ` Kevin Oberman
1999-07-14 4:00 ` T.E.Dickey
1999-07-15 4:00 ` libcurses and patches for 4.0 jhitchcock
1999-07-16 4:00 ` T.E.Dickey
1999-08-10 4:00 ` b_andreasen
1999-07-16 4:00 ` Dec C pecularity Tobias Ernst
1999-07-18 4:00 ` T.E.Dickey
1999-07-14 4:00 ` T.E.Dickey
1999-06-22 4:00 ` Jeff Sullivan
1999-06-22 4:00 ` Jeff Sullivan
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox