From af1cd893af6ec8f03eeaac8fb9dde4f562e33474 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 25 Jun 2000 12:29:19 +0000 Subject: [PATCH] 2000-06-25 14:25 UTC+0100 Victor Szakats --- harbour/ChangeLog | 34 ++++++++++++++++++ harbour/include/hbapigt.h | 3 -- harbour/include/hbapiitm.h | 1 + harbour/include/inkey.ch | 2 +- harbour/include/set.ch | 20 +++++------ harbour/include/simpleio.ch | 14 +++----- harbour/source/rtl/errorapi.c | 4 +-- harbour/source/rtl/idle.c | 11 +++--- harbour/source/rtl/objfunc.prg | 31 ++++++++--------- harbour/source/rtl/teditor.prg | 11 ++---- harbour/source/vm/fm.c | 63 +++++++++++++--------------------- harbour/source/vm/hvm.c | 27 +++------------ harbour/source/vm/itemapi.c | 8 +++++ harbour/tests/onidle.prg | 20 ++++++----- 14 files changed, 123 insertions(+), 126 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index e5ea831ebd..b25f9864dc 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,37 @@ +2000-06-25 14:25 UTC+0100 Victor Szakats + + * tests/onidle.prg + * source/rtl/idle.c + * Renamed some idle related Harbour level functions: + HB_ADDIDLE() -> HB_IDLEADD() + HB_DELIDLE() -> HB_IDLEDEL() + HB_IAMIDLE() -> HB_IDLESTATE() + + * source/rtl/objfunc.prg + * source/rtl/teditor.prg + % Small optimizations. + + * source/vm/fm.c + % Some optimizations on the hb_xquery() OS/2 branch, some other cleanups + and formattings made. + + * include/hbapigt.h + - Removed hb_releaseCPU() prototype. + + * source/vm/itemapi.c + * include/hbapiitm.h + * source/rtl/errorapi.c + + hb_itemInit() function added, to initialize a new HB_ITEM structure. + * errorapi.c now uses hb_itemInit() instead of the low-level item access. + + * include/inkey.ch + * include/set.ch + + Some comments added related to Harbour or C53 extensions. + + * source/vm/hvm.c + * include/simpleio.ch + * Minor changes. + 2000-06-25 03:35 UTC-0800 Ron Pinkas * source/compiler/hbgenerr.c ! Fixed line number when in was 1 too short. diff --git a/harbour/include/hbapigt.h b/harbour/include/hbapigt.h index a938458acc..3ed8522fa0 100644 --- a/harbour/include/hbapigt.h +++ b/harbour/include/hbapigt.h @@ -227,9 +227,6 @@ extern int hb_inkeyNext( void ); /* Return the next key without ext extern void hb_inkeyPoll( void ); /* Poll the console keyboard to stuff the Harbour buffer */ extern void hb_inkeyReset( BOOL allocate ); /* Reset the Harbour keyboard buffer */ -/* TOFIX: This should go somewhere else. */ -extern void hb_releaseCPU( void ); /* Attempt to release a CPU time slice */ - /* Mouse related declarations */ /* Public interface. These should never change, only be added to. */ diff --git a/harbour/include/hbapiitm.h b/harbour/include/hbapiitm.h index b903b1251f..c7025599ca 100644 --- a/harbour/include/hbapiitm.h +++ b/harbour/include/hbapiitm.h @@ -75,6 +75,7 @@ extern long hb_itemGetNL ( PHB_ITEM pItem ); extern void hb_itemGetNLen ( PHB_ITEM pItem, int * piWidth, int * piDec ); extern void * hb_itemGetPtr ( PHB_ITEM pItem ); extern PHB_ITEM hb_itemNew ( PHB_ITEM pNull ); +extern void hb_itemInit ( PHB_ITEM pItem ); extern USHORT hb_itemPCount ( void ); extern PHB_ITEM hb_itemParam ( USHORT uiParam ); extern PHB_ITEM hb_itemPutC ( PHB_ITEM pItem, char * szText ); diff --git a/harbour/include/inkey.ch b/harbour/include/inkey.ch index 781e0ca8f2..f5c8b29765 100644 --- a/harbour/include/inkey.ch +++ b/harbour/include/inkey.ch @@ -50,7 +50,7 @@ #define INKEY_RUP 16 #define INKEY_KEYBOARD 128 #define INKEY_ALL 159 -#define INKEY_RAW 256 +#define INKEY_RAW 256 /* Harbour extension */ /* Mouse events */ diff --git a/harbour/include/set.ch b/harbour/include/set.ch index c471207df2..fcc005559c 100644 --- a/harbour/include/set.ch +++ b/harbour/include/set.ch @@ -82,22 +82,22 @@ #define _SET_MCENTER 37 #define _SET_SCROLLBREAK 38 -#define _SET_EVENTMASK 39 +#define _SET_EVENTMASK 39 /* CA-Cl*pper 5.3 compatible */ -#define _SET_VIDEOMODE 40 +#define _SET_VIDEOMODE 40 /* CA-Cl*pper 5.3 compatible */ -#define _SET_MBLOCKSIZE 41 -#define _SET_MFILEEXT 42 +#define _SET_MBLOCKSIZE 41 /* CA-Cl*pper 5.3 compatible */ +#define _SET_MFILEEXT 42 /* CA-Cl*pper 5.3 compatible */ -#define _SET_STRICTREAD 43 -#define _SET_OPTIMIZE 44 -#define _SET_AUTOPEN 45 -#define _SET_AUTORDER 46 -#define _SET_AUTOSHARE 47 +#define _SET_STRICTREAD 43 /* CA-Cl*pper 5.3 compatible */ +#define _SET_OPTIMIZE 44 /* CA-Cl*pper 5.3 compatible */ +#define _SET_AUTOPEN 45 /* CA-Cl*pper 5.3 compatible */ +#define _SET_AUTORDER 46 /* CA-Cl*pper 5.3 compatible */ +#define _SET_AUTOSHARE 47 /* CA-Cl*pper 5.3 compatible */ #define _SET_COUNT 47 -#define _SET_LANGUAGE 100 +#define _SET_LANGUAGE 100 /* Harbour extension */ #define HB_SET_BASE 100 #define HB_SET_COUNT 1 diff --git a/harbour/include/simpleio.ch b/harbour/include/simpleio.ch index 7cb77bcb8a..8573fb725d 100644 --- a/harbour/include/simpleio.ch +++ b/harbour/include/simpleio.ch @@ -36,16 +36,10 @@ #ifndef _SIMPLEIO_CH #define _SIMPLEIO_CH -#command ? [ ] => ; - ( OutStd( hb_OSNewLine() ) [, OutStd()] ) +#command ? [ ] => ( OutStd( hb_OSNewLine() ) [, OutStd( ) ] ) +#command ?? [ ] => OutStd( ) -#command ?? [ ] => ; - OutStd( ) - -#command ACCEPT TO => ; - := StrTran( FReadStr( 0, 256 ), hb_OSNewLine() ) - -#command ACCEPT TO => ; - ? ; ACCEPT TO +#command ACCEPT TO => := StrTran( FReadStr( 0, 256 ), hb_OSNewLine() ) +#command ACCEPT TO => ? ; ACCEPT TO #endif /* _SIMPLEIO_CH */ diff --git a/harbour/source/rtl/errorapi.c b/harbour/source/rtl/errorapi.c index 5e691ff6e2..13e55a0726 100644 --- a/harbour/source/rtl/errorapi.c +++ b/harbour/source/rtl/errorapi.c @@ -102,7 +102,7 @@ HB_FUNC( ERRORBLOCK ) * NOTE: hb_itemClear() cannot be used to initialize an item because * memory occupied by the item can contain garbage bits */ - oldError.type = HB_IT_NIL; + hb_itemInit( &oldError ); hb_itemCopy( &oldError, &s_errorBlock ); if( pNewErrorBlock ) @@ -149,7 +149,7 @@ void hb_errInit( void ) * NOTE: hb_itemClear() cannot be used to initialize an item because * memory occupied by the item can contain garbage bits */ - s_errorBlock.type = HB_IT_NIL; + hb_itemInit( &s_errorBlock.type ); } void hb_errExit( void ) diff --git a/harbour/source/rtl/idle.c b/harbour/source/rtl/idle.c index d3a549831b..09b5fb4bc1 100644 --- a/harbour/source/rtl/idle.c +++ b/harbour/source/rtl/idle.c @@ -130,13 +130,13 @@ void hb_idleShutDown( void ) } /* signal that the user code is in idle state */ -HB_FUNC( HB_IAMIDLE ) +HB_FUNC( HB_IDLESTATE ) { hb_idleState(); } /* add a new background task and return its handle */ -HB_FUNC( HB_ADDIDLE ) +HB_FUNC( HB_IDLEADD ) { HB_ITEM_PTR pBlock = hb_param( 1, HB_IT_BLOCK ); @@ -164,11 +164,11 @@ HB_FUNC( HB_ADDIDLE ) } /* Delete a task with given handle and return a codeblock with this task */ -HB_FUNC( HB_DELIDLE ) +HB_FUNC( HB_IDLEDEL ) { BOOL bFound = FALSE; - if( s_pIdleTasks && ( hb_parinfo(1) & HB_IT_NUMERIC ) ) + if( s_pIdleTasks && ( hb_parinfo( 1 ) & HB_IT_NUMERIC ) ) { SHORT iTask; ULONG ulID = hb_parnl( 1 ); /* TODO: access to pointers from harbour code */ @@ -177,7 +177,7 @@ HB_FUNC( HB_DELIDLE ) iTask = 0; while( iTask < s_uiIdleMaxTask && !bFound ) { - if( ulID == ( ULONG )pItem->item.asBlock.value ) + if( ulID == ( ULONG ) pItem->item.asBlock.value ) { hb_gcUnlock( pItem->item.asBlock.value ); hb_itemReturn( pItem ); /* return a codeblock */ @@ -202,6 +202,7 @@ HB_FUNC( HB_DELIDLE ) ++iTask; } } + if( !bFound ) hb_ret(); /* return NIL */ } diff --git a/harbour/source/rtl/objfunc.prg b/harbour/source/rtl/objfunc.prg index a9376b4cdb..5c70936b26 100644 --- a/harbour/source/rtl/objfunc.prg +++ b/harbour/source/rtl/objfunc.prg @@ -74,35 +74,36 @@ FUNCTION __objGetMsgList( oObject, lDataMethod ) LOCAL aData LOCAL n LOCAL nLen - LOCAL lFoundDM // Found DATA ? IF !ISOBJECT( oObject ) __errRT_BASE( EG_ARG, 3101, NIL, ProcName( 0 ) ) ENDIF IF !ISLOGICAL( lDataMethod ) - lDataMethod := .T. + lDataMethod := .T. ENDIF - aInfo := aSort( oObject:ClassSel() ) - aData := {} - n := 1 - nLen := Len( aInfo ) + aInfo := ASort( oObject:ClassSel() ) + aData := {} + n := 1 + nLen := Len( aInfo ) - DO WHILE n <= nLen .AND. Substr( aInfo[ n ], 1, 1 ) != "_" + DO WHILE n <= nLen .AND. !( Substr( aInfo[ n ], 1, 1 ) == "_" ) /* If in range and no set function found yet ( set functions */ /* begin with a leading underscore ). */ - lFoundDM := !Empty( AScan( aInfo, "_" + aInfo[ n ], n + 1 ) ) + // If found -> DATA + // else METHOD /* Find position of matching set function in array with all symbols */ - IF lFoundDM == lDataMethod // If found -> DATA - // else METHOD + IF ( AScan( aInfo, {| tmp | tmp == ( "_" + aInfo[ n ] ) }, n + 1 ) != 0 ) == lDataMethod AAdd( aData, aInfo[ n ] ) ENDIF + n++ + ENDDO RETURN aData @@ -127,7 +128,7 @@ FUNCTION __objGetValueList( oObject, aExcept ) ENDIF IF !ISARRAY( aExcept ) - aExcept := {} + aExcept := {} ENDIF aDataSymbol := __objGetMsgList( oObject ) @@ -136,7 +137,7 @@ FUNCTION __objGetValueList( oObject, aExcept ) FOR n := 1 to nLen cSymbol := aDataSymbol[ n ] - IF Empty( AScan( aExcept, cSymbol ) ) + IF AScan( aExcept, {| tmp | tmp == cSymbol } ) == 0 AAdd( aData, { cSymbol, __objSendMsg( oObject, cSymbol ) } ) ENDIF NEXT @@ -178,11 +179,9 @@ FUNCTION __objAddData( oObject, cSymbol ) IF !ISOBJECT( oObject ) .OR. !ISCHARACTER( cSymbol ) __errRT_BASE( EG_ARG, 3101, NIL, ProcName( 0 ) ) - ELSEIF !__objHasMsg( oObject, cSymbol ) .AND. ; - !__objHasMsg( oObject, "_" + cSymbol ) - + ELSEIF !__objHasMsg( oObject, cSymbol ) .AND. !__objHasMsg( oObject, "_" + cSymbol ) nSeq := __cls_IncData( oObject:ClassH ) // Allocate new Seq# - __clsAddMsg( oObject:ClassH, cSymbol, nSeq, HB_OO_MSG_DATA ) + __clsAddMsg( oObject:ClassH, cSymbol, nSeq, HB_OO_MSG_DATA ) __clsAddMsg( oObject:ClassH, "_" + cSymbol, nSeq, HB_OO_MSG_DATA ) ENDIF diff --git a/harbour/source/rtl/teditor.prg b/harbour/source/rtl/teditor.prg index d41406e911..d6e1fc5b19 100644 --- a/harbour/source/rtl/teditor.prg +++ b/harbour/source/rtl/teditor.prg @@ -101,10 +101,8 @@ ENDCLASS // Returns EOL char (be it either CR or LF or both) STATIC function WhichEOL(cString) - local nCRPos, nLFPos - - nCRPos := At(Chr(13), cString) - nLFPos := At(Chr(10), cString) + local nCRPos := At(Chr(13), cString) + local nLFPos := At(Chr(10), cString) if nCRPos > 0 .AND. nLFPos == 0 return Chr(13) @@ -115,12 +113,9 @@ STATIC function WhichEOL(cString) elseif nCRPos > 0 .AND. nLFPos == nCRPos + 1 return Chr(13) + Chr(10) - else - return HB_OSNewLine() - endif -return nil +return HB_OSNewLine() // Converts a string to an array of strings splitting input string at EOL boundaries diff --git a/harbour/source/vm/fm.c b/harbour/source/vm/fm.c index 990323ade4..9ca4337994 100644 --- a/harbour/source/vm/fm.c +++ b/harbour/source/vm/fm.c @@ -51,17 +51,16 @@ #define HB_OS_WIN_32_USED +/* NOTE: For OS/2. Must be ahead of any and all #include statements */ +#define INCL_BASE +#define INCL_DOSMISC +#define INCL_DOSERRORS +#define INCL_DOSPROCESS + #ifndef __MPW__ #include #endif -#if (defined(__EMX__) && ! defined(__RSXNT__)) || defined(OS2) || defined(__OS2__) || defined(OS_2) - #define INCL_BASE - #define INCL_DOSMISC - #define INCL_DOSERRORS - #define INCL_DOSPROCESS -#endif - #include "hbapi.h" #include "hbapierr.h" #include "hbmemory.ch" @@ -226,7 +225,7 @@ void * hb_xgrab( ULONG ulSize ) /* allocates fixed memory, exits on fail } } - s_lMemoryConsumed += ulSize; + s_lMemoryConsumed += ulSize; if( s_lMemoryMaxConsumed < s_lMemoryConsumed ) s_lMemoryMaxConsumed = s_lMemoryConsumed; s_lMemoryBlocks++; @@ -440,6 +439,7 @@ void * hb_xmemcpy( void * pDestArg, void * pSourceArg, ULONG ulLen ) pDest += iCopySize; pSource += iCopySize; } + return pDestArg; } @@ -470,6 +470,7 @@ void * hb_xmemset( void * pDestArg, int iFill, ULONG ulLen ) memset( pDest, iFill, iSetSize ); pDest += iSetSize; } + return pDestArg; } @@ -495,14 +496,11 @@ ULONG hb_xquery( USHORT uiMode ) #elif defined(HB_OS_OS2) { ULONG ulSysInfo = 0; - APIRET rc; - rc = DosQuerySysInfo(QSV_TOTAVAILMEM, QSV_TOTAVAILMEM, &ulSysInfo, sizeof(ULONG)); - if (rc != NO_ERROR) { + if( DosQuerySysInfo( QSV_TOTAVAILMEM, QSV_TOTAVAILMEM, &ulSysInfo, sizeof( ULONG ) ) != NO_ERROR ) ulResult = 0; - } else { + else ulResult = ulSysInfo / 1024; - } } #else ulResult = 9999; @@ -519,14 +517,11 @@ ULONG hb_xquery( USHORT uiMode ) #elif defined(HB_OS_OS2) { ULONG ulSysInfo = 0; - APIRET rc; - rc = DosQuerySysInfo(QSV_TOTAVAILMEM, QSV_TOTAVAILMEM, &ulSysInfo, sizeof(ULONG)); - if (rc != NO_ERROR) { + if( DosQuerySysInfo( QSV_TOTAVAILMEM, QSV_TOTAVAILMEM, &ulSysInfo, sizeof( ULONG ) ) != NO_ERROR ) ulResult = 0; - } else { - ulResult = HB_MIN(ulSysInfo, ULONG_MAX) / 1024; - } + else + ulResult = HB_MIN( ulSysInfo, ULONG_MAX ) / 1024; } #else ulResult = 9999; @@ -543,14 +538,11 @@ ULONG hb_xquery( USHORT uiMode ) #elif defined(HB_OS_OS2) { ULONG ulSysInfo = 0; - APIRET rc; - rc = DosQuerySysInfo(QSV_TOTAVAILMEM, QSV_TOTAVAILMEM, &ulSysInfo, sizeof(ULONG)); - if (rc != NO_ERROR) { + if( DosQuerySysInfo( QSV_TOTAVAILMEM, QSV_TOTAVAILMEM, &ulSysInfo, sizeof( ULONG ) ) != NO_ERROR ) ulResult = 0; - } else { + else ulResult = ulSysInfo / 1024; - } } #else ulResult = 9999; @@ -567,14 +559,11 @@ ULONG hb_xquery( USHORT uiMode ) #elif defined(HB_OS_OS2) { ULONG ulSysInfo = 0; - APIRET rc; - rc = DosQuerySysInfo(QSV_TOTAVAILMEM, QSV_TOTAVAILMEM, &ulSysInfo, sizeof(ULONG)); - if (rc != NO_ERROR) { + if( DosQuerySysInfo( QSV_TOTAVAILMEM, QSV_TOTAVAILMEM, &ulSysInfo, sizeof( ULONG ) ) != NO_ERROR ) ulResult = 0; - } else { + else ulResult = ulSysInfo / 1024; - } } #else ulResult = 9999; @@ -599,14 +588,11 @@ ULONG hb_xquery( USHORT uiMode ) #elif defined(HB_OS_OS2) { ULONG ulSysInfo = 0; - APIRET rc; - rc = DosQuerySysInfo(QSV_MAXPRMEM, QSV_MAXPRMEM, &ulSysInfo, sizeof(ULONG)); - if (rc != NO_ERROR) { + if( DosQuerySysInfo( QSV_MAXPRMEM, QSV_MAXPRMEM, &ulSysInfo, sizeof( ULONG ) ) != NO_ERROR ) ulResult = 0; - } else { + else ulResult = ulSysInfo / 1024; - } } #else ulResult = 9999; @@ -630,11 +616,10 @@ ULONG hb_xquery( USHORT uiMode ) } #elif defined(HB_OS_OS2) { - /* 10/05/2000 - maurilio.longo@libero.it - There is no way to know how much a swap file can grow on an OS/2 system. - I think we should return free space on DASD media which contains swap - file */ - ulResult = 0; + /* NOTE: There is no way to know how much a swap file can grow on an + OS/2 system. I think we should return free space on DASD + media which contains swap file [maurilio.longo] */ + ulResult = 9999; } #else ulResult = 9999; diff --git a/harbour/source/vm/hvm.c b/harbour/source/vm/hvm.c index 27e13f26c9..51ff9506bd 100644 --- a/harbour/source/vm/hvm.c +++ b/harbour/source/vm/hvm.c @@ -191,10 +191,9 @@ static void hb_vmReleaseLocalSymbols( void ); /* releases the memory of the #endif #endif -static void hb_vmProcessObjSymbols ( void ); /* process Harbour generated OBJ symbols */ -void hb_vmProcessBorlandInitSegment( void ); /* process Borland _INIT_ segment functions - when not using Borland startup */ -void hb_startup( void ); /* Harbour startup when not using a C compiler startup */ +static void hb_vmProcessObjSymbols( void ); /* process Harbour generated OBJ symbols */ +extern void hb_vmProcessBorlandInitSegment( void ); /* process Borland _INIT_ segment functions when not using Borland startup */ +extern void hb_startup( void ); /* Harbour startup when not using a C compiler startup */ typedef struct { @@ -2750,15 +2749,6 @@ void hb_vmDo( USHORT uiParams ) hb_errInternal( IE_VMNOTSYMBOL, NULL, "hb_vmDo()", NULL ); } -#if 0 - if( ! HB_IS_NIL( pSelf ) ) - { - /* QUESTION: Is this call needed ? [vszakats] */ - hb_stackDispLocal(); - hb_errInternal( IE_VMINVSYMBOL, NULL, "hb_vmDo()", NULL ); - } -#endif - pItem->item.asSymbol.lineno = 0; pItem->item.asSymbol.paramcnt = uiParams; hb_stack.pBase = hb_stack.pItems + pItem->item.asSymbol.stackbase; @@ -2857,15 +2847,6 @@ void hb_vmSend( USHORT uiParams ) hb_errInternal( IE_VMNOTSYMBOL, NULL, "hb_vmSend()", NULL ); } -#if 0 - if( ! HB_IS_NIL( pSelf ) ) - { - /* QUESTION: Is this call needed ? [vszakats] */ - hb_stackDispLocal(); - hb_errInternal( IE_VMINVSYMBOL, NULL, "hb_vmSend()", NULL ); - } -#endif - pItem->item.asSymbol.lineno = 0; pItem->item.asSymbol.paramcnt = uiParams; hb_stack.pBase = hb_stack.pItems + pItem->item.asSymbol.stackbase; @@ -2998,7 +2979,7 @@ HB_ITEM_PTR hb_vmEvalBlockV( HB_ITEM_PTR pBlock, USHORT uiArgCount, ... ) hb_vmPush( pBlock ); va_start( va, uiArgCount ); - for( i=1; i<= uiArgCount; i++ ) + for( i = 1; i <= uiArgCount; i++ ) hb_vmPush( va_arg( va, PHB_ITEM ) ); va_end( va ); diff --git a/harbour/source/vm/itemapi.c b/harbour/source/vm/itemapi.c index 20e83b8b4c..429f0f3561 100644 --- a/harbour/source/vm/itemapi.c +++ b/harbour/source/vm/itemapi.c @@ -1003,6 +1003,14 @@ char * hb_itemTypeStr( PHB_ITEM pItem ) /* Internal API, not standard Clipper */ +void hb_itemInit( PHB_ITEM pItem ) +{ + HB_TRACE(HB_TR_DEBUG, ("hb_itemInit(%p)", pItem)); + + if( pItem ) + pItem->type = HB_IT_NIL; +} + void hb_itemClear( PHB_ITEM pItem ) { HB_TRACE(HB_TR_DEBUG, ("hb_itemClear(%p)", pItem)); diff --git a/harbour/tests/onidle.prg b/harbour/tests/onidle.prg index 87c14f2aad..c216fc1d77 100644 --- a/harbour/tests/onidle.prg +++ b/harbour/tests/onidle.prg @@ -1,6 +1,7 @@ // // $Id$ // + #include "hbmemory.ch" FUNCTION MAIN @@ -15,16 +16,16 @@ LOCAL nPrev:=SECONDS() ? "Can you see it ??? :) Press ESC or wait 5 seconds" ? ? - nH1 = HB_ADDIDLE( {|| DEVPOS(0,01), DEVOUT( TIME() )} ) - nH2 = HB_ADDIDLE( {|| DEVPOS(0,21), TEST(), DEVOUT( MEMORY(HB_MEM_USED) )} ) - nH3 = HB_ADDIDLE( {|| DEVPOS(0,41), IIF(n=4,n:=1,n++),DEVOUT(aSign[n]) } ) - nH4 = HB_ADDIDLE( {|| DEVPOS(0,61), DEVOUT( 1000*(SECONDS()-nPrev) ), nPrev:=SECONDS()} ) + nH1 = HB_IDLEADD( {|| DEVPOS(0,01), DEVOUT( TIME() )} ) + nH2 = HB_IDLEADD( {|| DEVPOS(0,21), TEST(), DEVOUT( MEMORY(HB_MEM_USED) )} ) + nH3 = HB_IDLEADD( {|| DEVPOS(0,41), IIF(n=4,n:=1,n++),DEVOUT(aSign[n]) } ) + nH4 = HB_IDLEADD( {|| DEVPOS(0,61), DEVOUT( 1000*(SECONDS()-nPrev) ), nPrev:=SECONDS()} ) INKEY( 10 ) - HB_DELIDLE( nH3 ) - HB_DELIDLE( nH2 ) - HB_DELIDLE( nH1 ) - HB_DELIDLE( nH4 ) + HB_IDLEDEL( nH3 ) + HB_IDLEDEL( nH2 ) + HB_IDLEDEL( nH1 ) + HB_IDLEDEL( nH4 ) RETURN 1 @@ -43,4 +44,5 @@ LOCAL cb // EVAL( cb, 20 ) // INKEY( .5 ) -RETURN \ No newline at end of file +RETURN +