Files
harbour-core/harbour/tests/mt/mttest11.prg
Viktor Szakats 70140e5aed 2012-07-22 23:52 UTC+0200 Viktor Szakats (vszakats syenar.net)
* contrib/hbct/tests/ctwtest.prg
  * contrib/hbcups/tests/test.prg
  * contrib/hbfbird/tests/stress.prg
  * contrib/hbnf/aredit.prg
  * contrib/hbnf/doc/en/aredit.txt
  * contrib/hbnf/menu1.prg
  * contrib/hbnf/popadder.prg
  * contrib/hbnf/tbwhile.prg
  * contrib/hbpgsql/tests/async.prg
  * contrib/hbpgsql/tests/cache.prg
  * contrib/hbpgsql/tests/stress.prg
  * contrib/hbpgsql/tests/test.prg
  * contrib/hbtip/tests/tiptest.prg
  * contrib/xhb/tests/compress.prg
  * doc/en/sayget.txt
  * src/rtl/profiler.prg
  * tests/ac_test.prg
  * tests/boxtst2.prg
  * tests/fortest.prg
  * tests/menutest.prg
  * tests/mt/mttest11.prg
  * tests/parseini.prg
  * tests/speedold.prg
  * tests/tstchbx.prg
  * tests/usrrdd/exarr.prg
  * tests/videotst.prg
  * tests/vidtest.prg
    * formatting
    ! deleted SetMode()s
    * CLEAR SCREEN -> CLS
    * other minor cleanups
2012-07-22 21:54:14 +00:00

52 lines
1.2 KiB
Plaintext

/*
* $Id$
*/
/*
* Harbour Project source code:
* demonstration/test code for asynchronous screen updating without
* breaking foreground screen operations.
*
* Copyright 2008 Przemyslaw Czerpak <druzus / at / priv.onet.pl>
* www - http://harbour-project.org
*
*/
proc main()
local getList := {}
local cVar := space( 20 )
CLS
if ! hb_mtvm()
? "No MT support in HVM. Clock will not be shown."
WAIT
else
hb_threadStart( @thFunc() )
endif
@ 10, 10 SAY "Insert cVar:" GET cVar
READ
SetPos( 12, 0 )
? "Result -> [" + cVar + "]"
WAIT
return
func thFunc()
local cTime
while .T.
cTime := dtoc( date() ) + " " + time()
/* use hb_dispOutAt() which does not change current default
* color and cursor position so can be executed without bad
* side effects for other threads which updates screen.
* This functions also accepts colors as numeric values.
* Similar functionality have hb_dispBox() and hb_scroll().
* All these functions changes only screen buffer but do not
* touch cursor position and current color settings.
*/
hb_dispOutAt( 0, maxcol() - len( cTime ) + 1, cTime, "GR+/N" )
hb_idleSleep( 1 )
enddo
return nil