I wonder if it is possible to print a carriage return without a line feed in erlang? i.e. equivalent printf("this will be replaced next time \r");to C.
printf("this will be replaced next time \r");
I looked at the io: format () document and did not see anything. It seems to support ~ n, equivalent to the carriage + line return pairs ('\ n' in C).
thank.
"\ r" is a valid escape sequence in Erlang. That way you can only do
io:format("\r").
Refer to the reference guide for other escape sequences.
You can use \rin a string for the return character like this:
\r
io:format("Counter value: ~b\r", [Counter])
, $\r .
$\r
Doh. . ~c ASCII, ASCII- (13). .
~c
io:format("Counter value: ~b~c", [Counter,13])
Still interested in something more elegant ...