[Tutor] Return cursor to beginning of line, to overprint, in DOS/windows

Gerrit Holl gerrit@nl.linux.org
Thu Feb 20 09:06:01 2003


R. Alan Monroe schreef op woensdag 19 februari om 23:56:25 +0000:
> > R. Alan Monroe schreef op woensdag 19 februari om 05:09:28 +0000:
> >> Is there a special backslash code I can use in a print statement to
> >> move the cursor back to beginning of the line, to keep printing on the
> >> same line over and over? I tried "\r" but that didn't work.
> 
> > Works here:
> >   0 >>> print "aaa\rb"
> >   baa
> > What did you try exactly? Remember that 'print' prints a newline
> > after the expression.
> 
> I didn't know about the newline. I fooled around with it and found
> adding a trailing comma makes it work like I want, using \r. Is there
> a control code for "clear to end of line"? Where's the reference for
> these codes? I can't find them on Google or in the supplied docs, but
> I must not be searching correctly. The \r I just happened to remember
> from reading it somewhere.

Me too. I am currently unable to find it, mut the Unix man page printf
has the following information:

       \\     backslash

       \a     alert (BEL)

       \b     backspace

       \c     produce no further output

       \f     form feed

       \n     new line

       \r     carriage return

       \t     horizontal tab

       \v     vertical tab

yours,
Gerrit.

-- 
Asperger Syndroom - een persoonlijke benadering:
	http://people.nl.linux.org/~gerrit/
Het zijn tijden om je zelf met politiek te bemoeien:
	http://www.sp.nl/