[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: how to go back on previous line with printf
From: |
David Haddon |
Subject: |
Re: how to go back on previous line with printf |
Date: |
Tue, 2 Sep 2008 09:37:29 +1000 |
On Sun, 2008-08-31 at 23:52 -0700, pauljoseph wrote:
> Hi,
> Is there anyway we can move the cursor back to the previous line using
> printf? For example if I do
>
> printf('test line 1.\n');
>
> The \n will change to the next line. May I know what character I can use to
> go back to the "test line 1." and put the cursor back after the dot?
>
> Thanks.
If you use '\r' that will take you to the beginning of the line.
for i = 1:10
printf("Line %d of 10 \r",i)
endfor
This will print the message on the same line in a standard Octave shell.
When testing it, I found that it doesn't work under the QtOctave
though... QtOctave does make some changes though.
I hope this helps.
David