This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Clear Screen


In gmane.os.ecos.general, you wrote:

> I wan't to know if it's possible to clear the screen or update a
> specific line with eCos?

Depends on what screen you're using.

> I have an application that writes data on the screen with
> printf() and I want to clear this data and write new. Is there
> a clear screen function or something like it?

Assuming you're using an ANSI terminal, writing such functions
is pretty simple:

void clearScreen(void)
  {    
    printf("\033[2J")
  }

void clearToEOL(void)
  {
    printf("\033[K")  
  }  
  
void moveCursor(int row, int col)
  {
    printf("\033[%d;%dH",row, col)
  }  

and so on.
  
-- 
Grant Edwards                   grante             Yow!  Here I am in 53
                                  at               B.C. and all I want is a
                               visi.com            dill pickle!!

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]