2000-11-24 12:50 UTC+0800 Ron Pinkas <ron@profit-master.com>
* include/hbset.h
* include/set.ch
* source/pp/pptable.c
+ Added _SET_IDLEREPEAT = 101
* source/rtl/set.c
+ Added suport for SET( _SET_IDLEREPEAT ) - Default is .T.
* source/rtl/idle.c
- Removed HB_IDLE_RESET()
* Changed handling of Idle Process to default to REPEAT.
* tests/onidle.prg
- Removed call to HB_IDLE_RESET()
+ tests/testidle.prg
+ New test of Idle Blocks in default (REPEAT) mode and optional NON REPEAT mode.
This commit is contained in:
@@ -1,3 +1,21 @@
|
||||
2000-11-24 12:50 UTC+0800 Ron Pinkas <ron@profit-master.com>
|
||||
* include/hbset.h
|
||||
* include/set.ch
|
||||
* source/pp/pptable.c
|
||||
+ Added _SET_IDLEREPEAT = 101
|
||||
* source/rtl/set.c
|
||||
+ Added suport for SET( _SET_IDLEREPEAT ) - Default is .T.
|
||||
|
||||
* source/rtl/idle.c
|
||||
- Removed HB_IDLE_RESET()
|
||||
* Changed handling of Idle Process to default to REPEAT.
|
||||
|
||||
* tests/onidle.prg
|
||||
- Removed call to HB_IDLE_RESET()
|
||||
|
||||
+ tests/testidle.prg
|
||||
+ New test of Idle Blocks in default (REPEAT) mode and optional NON REPEAT mode.
|
||||
|
||||
2000-11-24 19:22 GMT+1 Maurilio Longo <maurilio.longo@libero.it>
|
||||
* contrib/mysql/tmysql.prg
|
||||
+ ::FieldGet() and ::FieldPut() methods now accept a field name as field identifier and not
|
||||
|
||||
@@ -100,13 +100,14 @@ typedef enum
|
||||
HB_SET_MFILEEXT = 42,
|
||||
|
||||
HB_SET_STRICTREAD = 43,
|
||||
HB_SET_OPTIMIZE = 44,
|
||||
HB_SET_OPTIMIZE = 44,
|
||||
HB_SET_AUTOPEN = 45,
|
||||
HB_SET_AUTORDER = 46,
|
||||
HB_SET_AUTOSHARE = 47,
|
||||
|
||||
/* Harbour SET extensions start at 100 */
|
||||
HB_SET_LANGUAGE = 100
|
||||
HB_SET_LANGUAGE = 100,
|
||||
HB_SET_IDLEREPEAT = 101
|
||||
} HB_set_enum;
|
||||
|
||||
typedef struct
|
||||
@@ -172,4 +173,4 @@ extern void hb_setRelease( void );
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* HB_SET_H_ */
|
||||
#endif /* HB_SET_H_ */
|
||||
|
||||
@@ -98,8 +98,9 @@
|
||||
#define _SET_COUNT 47
|
||||
|
||||
#define _SET_LANGUAGE 100 /* Harbour extension */
|
||||
#define _SET_IDLEREPEAT 101 /* Harbour extension */
|
||||
|
||||
#define HB_SET_BASE 100
|
||||
#define HB_SET_COUNT 1
|
||||
#define HB_SET_COUNT 2
|
||||
|
||||
#endif /* _SET_CH */
|
||||
|
||||
@@ -103,6 +103,7 @@ void hb_pp_Table( void )
|
||||
static DEFINES sD___49 = {"_SET_AUTORDER",NULL,-1,"46", &sD___48 };
|
||||
static DEFINES sD___50 = {"_SET_AUTOSHARE",NULL,-1,"47", &sD___49 };
|
||||
static DEFINES sD___51 = {"_SET_LANGUAGE",NULL,-1,"100", &sD___50 };
|
||||
static DEFINES sD___52 = {"_SET_IDLEREPEAT",NULL,-1,"101", &sD___51 };
|
||||
|
||||
static COMMANDS sC___1 = {0,"NOTE","\1A30",NULL,NULL };
|
||||
static COMMANDS sC___2 = {0,"DO","WHILE \1A00","while \1A00",&sC___1 };
|
||||
@@ -398,7 +399,7 @@ void hb_pp_Table( void )
|
||||
static COMMANDS sC___238 = {0,"SET","ORDER TO TAG \1A40 [IN \1B40]","ordSetFocus( \1A30 [, \1B30] )",&sC___237 };
|
||||
static COMMANDS sC___239 = {0,"SET","ORDER TO","ordSetFocus(0)",&sC___238 };
|
||||
|
||||
hb_pp_topDefine = &sD___51;
|
||||
hb_pp_topDefine = &sD___52;
|
||||
hb_pp_topCommand = &sC___239;
|
||||
hb_pp_topTranslate = NULL;
|
||||
}
|
||||
|
||||
@@ -69,8 +69,8 @@ USHORT hb_vm_uiIdleMaxTask = 0;
|
||||
/* flag to indicate GarbageCollection should be done in idle state. */
|
||||
BOOL hb_vm_bCollectGarbage = TRUE;
|
||||
|
||||
/* Dont allow repeated processing of Idle Tasks by default */
|
||||
BOOL hb_vm_bResetIdle = FALSE;
|
||||
/* Allow repeated processing of Idle Tasks by default */
|
||||
BOOL hb_vm_bIdleRepeat = TRUE;
|
||||
|
||||
int hb_inkeyNext( void ); /* Return the next key without extracting it */
|
||||
|
||||
@@ -144,9 +144,8 @@ void hb_idleState( void )
|
||||
return;
|
||||
}
|
||||
|
||||
if( hb_vm_bResetIdle && hb_vm_uiIdleTask == hb_vm_uiIdleMaxTask )
|
||||
if( hb_vm_bIdleRepeat && hb_vm_uiIdleTask == hb_vm_uiIdleMaxTask )
|
||||
{
|
||||
hb_vm_bResetIdle = FALSE;
|
||||
hb_vm_uiIdleTask = 0;
|
||||
hb_vm_bCollectGarbage = TRUE;
|
||||
|
||||
@@ -185,17 +184,11 @@ HB_FUNC( HB_IDLESTATE )
|
||||
|
||||
if( hb_vm_uiIdleTask == hb_vm_uiIdleMaxTask )
|
||||
{
|
||||
hb_vm_bResetIdle = FALSE;
|
||||
hb_vm_uiIdleTask = 0;
|
||||
hb_vm_bCollectGarbage = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
HB_FUNC( HB_IDLE_RESET )
|
||||
{
|
||||
hb_vm_bResetIdle = TRUE;
|
||||
}
|
||||
|
||||
/* add a new background task and return its handle */
|
||||
HB_FUNC( HB_IDLEADD )
|
||||
{
|
||||
|
||||
@@ -43,6 +43,8 @@
|
||||
#include "hbapilng.h"
|
||||
#include "hbset.h"
|
||||
|
||||
extern hb_vm_bIdleRepeat;
|
||||
|
||||
HB_SET_STRUCT hb_set;
|
||||
|
||||
static BOOL set_logical( PHB_ITEM pItem )
|
||||
@@ -209,7 +211,7 @@ static FHANDLE open_handle( char * file_name, BOOL bAppend, char * def_ext, HB_s
|
||||
{
|
||||
USHORT uiAction;
|
||||
|
||||
/* NOTE: using switch() here will result in a compiler warning.
|
||||
/* NOTE: using switch() here will result in a compiler warning.
|
||||
[vszakats] */
|
||||
if( set_specifier == HB_SET_ALTFILE )
|
||||
uiAction = hb_errRT_TERM( EG_CREATE, 2013, NULL, path, hb_fsError(), EF_CANDEFAULT | EF_CANRETRY );
|
||||
@@ -617,6 +619,10 @@ HB_FUNC( SET )
|
||||
hb_langSelectID( hb_itemGetCPtr( pArg2 ) );
|
||||
}
|
||||
break;
|
||||
case HB_SET_IDLEREPEAT :
|
||||
hb_retl( hb_vm_bIdleRepeat );
|
||||
if( args > 1 ) hb_vm_bIdleRepeat = set_logical( pArg2 );
|
||||
break;
|
||||
default :
|
||||
/* Return NIL if called with invalid SET specifier */
|
||||
break;
|
||||
@@ -670,7 +676,7 @@ void hb_setInitialize( void )
|
||||
hb_set.HB_SET_MESSAGE = 0;
|
||||
hb_set.HB_SET_MFILEEXT = ( char * ) hb_xgrab( 1 );
|
||||
hb_set.HB_SET_MFILEEXT[ 0 ] = '\0';
|
||||
hb_set.HB_SET_OPTIMIZE = FALSE;
|
||||
hb_set.HB_SET_OPTIMIZE = FALSE;
|
||||
hb_set.HB_SET_PATH = ( char * ) hb_xgrab( 1 );
|
||||
hb_set.HB_SET_PATH[ 0 ] = '\0';
|
||||
hb_set.HB_SET_PRINTER = FALSE;
|
||||
|
||||
@@ -21,7 +21,7 @@ LOCAL nPrev:=SECONDS()
|
||||
@ 11,2 SAY "Memory after TEST() and before collecting" + STR( MEMORY(HB_MEM_USED) )
|
||||
HB_GCALL()
|
||||
@ 12,2 SAY "Memory after collecting" + STR( MEMORY(HB_MEM_USED) )
|
||||
nH1 = HB_IDLEADD( {|| DEVPOS(0,01), DEVOUT( TIME() ), HB_IDLE_RESET() } )
|
||||
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() } )
|
||||
|
||||
28
harbour/tests/testidle.prg
Normal file
28
harbour/tests/testidle.prg
Normal file
@@ -0,0 +1,28 @@
|
||||
// #include "set.ch" - Preset in pptable.c
|
||||
|
||||
PROCEDURE MAIN()
|
||||
|
||||
LOCAL bIdle := {|| QOut( "Idle Block" ) }
|
||||
|
||||
CLS
|
||||
|
||||
? _SET_IDLEREPEAT
|
||||
|
||||
? "DEFAULT IDLEREPEAT =", SET( _SET_IDLEREPEAT )
|
||||
?
|
||||
? "Idle Block should be displayed multiple times until key or 10 seconds elapsed!"
|
||||
? "Press any key to begin..."
|
||||
?
|
||||
Inkey(0)
|
||||
|
||||
HB_IDLEADD( bIdle )
|
||||
Inkey( 2 )
|
||||
|
||||
SET( _SET_IDLEREPEAT, .F. )
|
||||
|
||||
CLS
|
||||
? "Idle Block should display ONCE! while waitning for key or 10 seconds elapsed!"
|
||||
?
|
||||
Inkey( 2 )
|
||||
|
||||
RETURN
|
||||
Reference in New Issue
Block a user