Amanda Wynne wrote:
if \n is newline, and \t is horizontal tab what's "home"; as in put the cursor back to the start of the current line? I've searched high & low, but can't seem to find any info anywhere.

Carriage Return.


Don't rely on this not to do a Line Feed, manufacturers
differ on this point (see, they can't even agree on ASCII!).

The reason C has such a small range of easy-to-type control
characters is that they are about all that is standard.  Even
then \n (Line Feed) might issue a Carriage Return to your
terminal to have the desired "new line" effect and \t (Tab)
might not have 8th column tab stops.  Similarly, Form Feed
might or might not clear the screen and Null and Delete might or
might not print characters.

What is needed is a library to hide all these issues from
your program (such as ncurses) or for your application to
avoid this tar pit altogether.

The choice will depend on what you use the program for.
I'd try and avoid screen formatting ask much as you can.
If you must do it, have a isatty() call that suppresses
the screen formating so you can say

myprogram > file.txt

without file.txt containing a world of screen movement
characters.

--
 Glen Turner                (08) 8303 3936 or +61 8 8303 3936
 Australian Academic and Research Network   www.aarnet.edu.au

--
SLUG - Sydney Linux User's Group - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug

Reply via email to