PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

ncurses_clrtobot> <ncurses_cbreak
Last updated: Fri, 22 Aug 2008

view this page in

ncurses_clear

(PHP 4 >= 4.0.7, PHP 5, PECL ncurses:1.0.0)

ncurses_clearLimpiar la pantalla

Descripción

bool ncurses_clear ( void )
Warning

Esta función es EXPERIMENTAL. Esto significa que el comportamiento de esta función, el nombre de esta función y en definitiva TODO lo documentado sobre esta función, puede cambiar en una futura version de PHP SIN AVISO. La advertencia queda hecha, y utilizar esta extensión queda bajo su propia responsabilidad.

Limpia la pantalla completamente sin usar caracteres en blanco.

Nota: ncurses_clear() limpia la pantalla sin usar caracteres en blanco, que tienen la misma apariencia del segundo plano actual. Para limpiar la pantalla con caracteres en blanco, use ncurses_erase().

Valores retornados

Devuelve TRUE si todo se llevó a cabo correctamente, FALSE en caso de fallo.

Ver también



add a note add a note User Contributed Notes
ncurses_clear
areaz at dotgeek org
14-May-2004 12:49
When your script exits, after ncurses_clear() was called, it could leave your terminal in an inconsistent state.

Therefore, you should call ncurses_savetty() in a constructor and nurses_resetty() in a destructor, to ensure, that your terminal is working fine after your script exits.

Here is an example code snippet, on how to use this function, without falling into trouble ;-)

<? // PHP5 Example

class foo
{
   
/* Foo constructor */
   
function __construct()
    {
       
/* Initialize ncurses first */
       
ncurses_init();

       
/* Save your tty !!! */
       
ncurses_savetty();
    }

    function
bar ()
    {
       
/* Clear the screen and wait a few seconds */
       
ncurses_clear();

       
sleep(5);
    }

   
/* Foo destructor */
   
function __destruct()
    {
       
/* Restore your terminal settings */
       
ncurses_resetty();

       
/* End ncurses and clean up */
       
ncurses_end();
    }

}

$test_ncurses = new foo;
$test_ncurses->bar();
?>

ncurses_clrtobot> <ncurses_cbreak
Last updated: Fri, 22 Aug 2008
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites