help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to go back on previous line with printf


From: Jaroslav Hajek
Subject: Re: how to go back on previous line with printf
Date: Mon, 1 Sep 2008 09:47:37 +0200

On Mon, Sep 1, 2008 at 8:52 AM, pauljoseph <address@hidden> 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?
>

AFAIK this is not possible using standard console output. For
instance, the output may be redirected to a printer, and you simply
can't go back. If your terminal supports ANSI escape sequences (most
of them do), then you can use them to accomplish this.
If you are trying to do something like progress reporting, then it's
better to not print the linefeed \n until done.

cheers

> Thanks.
> --
> View this message in context: 
> http://www.nabble.com/how-to-go-back-on-previous-line-with-printf-tp19249702p19249702.html
> Sent from the Octave - General mailing list archive at Nabble.com.
>
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
>



-- 
RNDr. Jaroslav Hajek
computing expert
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz


reply via email to

[Prev in Thread] Current Thread [Next in Thread]