From c899c8d85f3b62e3eab84581653550e251e9cf04 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 4 Apr 2000 10:44:09 +0000 Subject: [PATCH] 20000404-13:00 GMT+1 Victor Szakats --- harbour/ChangeLog | 12 +++++ harbour/source/rdd/dbstrux.prg | 9 ++-- harbour/source/rtl/getsys.prg | 82 +++++++++++++++++++--------------- harbour/source/vm/cmdarg.c | 6 +-- 4 files changed, 64 insertions(+), 45 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index a2f1d1c5e9..0d35757ad7 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,15 @@ +20000404-13:00 GMT+1 Victor Szakats + + * source/rdd/dbstrux.prg + % Some more optimization. Thanks to Chen Kedem. + + * source/rtl/getsys.prg + % __GetListActive() calls optimized out. + + * source/vm/cmdarg.c + * Change wording to "compatible" when talking about the other commercial + products. + 20000404-12:13 GMT+1 Victor Szakats * source/pp/ppcore.c diff --git a/harbour/source/rdd/dbstrux.prg b/harbour/source/rdd/dbstrux.prg index c60b557f99..ee9894de36 100644 --- a/harbour/source/rdd/dbstrux.prg +++ b/harbour/source/rdd/dbstrux.prg @@ -89,7 +89,7 @@ FUNCTION __dbCreate( cFileName, cFileFrom, cRDDName, lNew, cAlias ) DEFAULT lNew TO .F. - IF Used() .AND. !lNew + IF Used() .AND. ! lNew dbCloseArea() ENDIF @@ -106,11 +106,8 @@ FUNCTION __dbCreate( cFileName, cFileFrom, cRDDName, lNew, cAlias ) ELSE - IF lNew - USE ( cFileFrom ) NEW - ELSE - USE ( cFileFrom ) - ENDIF + dbUseArea( lNew,, cFileFrom ) + dbEval( {|| aAdd( aStruct, { FIELD->FIELD_NAME ,; FIELD->FIELD_TYPE ,; FIELD->FIELD_LEN ,; diff --git a/harbour/source/rtl/getsys.prg b/harbour/source/rtl/getsys.prg index 53bb445598..dcc43fe28f 100644 --- a/harbour/source/rtl/getsys.prg +++ b/harbour/source/rtl/getsys.prg @@ -36,7 +36,6 @@ #include "common.ch" FUNCTION ReadModal( GetList, nPos ) - LOCAL oGetList IF Empty( GetList ) @@ -80,57 +79,62 @@ PROCEDURE GetReader( oGet ) RETURN FUNCTION GetActive( oGet ) + LOCAL oGetList := __GetListActive() - IF __GetListActive() != NIL - IF PCount() > 0 - RETURN __GetListActive():GetActive( oGet ) + IF oGetList != NIL + IF PCount() >= 1 + RETURN oGetList:GetActive( oGet ) ELSE - RETURN __GetListActive():GetActive() + RETURN oGetList:GetActive() ENDIF ENDIF RETURN NIL PROCEDURE GetDoSetKey( keyBlock, oGet ) + LOCAL oGetList := __GetListActive() - IF __GetListActive() != NIL + IF oGetList != NIL IF oGet != NIL - __GetListActive():oGet := oGet + oGetList:oGet := oGet ENDIF - __GetListActive():GetDoSetKey( keyBlock ) + oGetList:GetDoSetKey( keyBlock ) ENDIF RETURN PROCEDURE GetApplyKey( oGet, nKey ) + LOCAL oGetList := __GetListActive() - IF __GetListActive() != NIL - __GetListActive():oGet := oGet - __GetListActive():GetApplyKey( nKey ) + IF oGetList != NIL + oGetList:oGet := oGet + oGetList:GetApplyKey( nKey ) ENDIF RETURN FUNCTION GetPreValidate( oGet ) + LOCAL oGetList := __GetListActive() - IF __GetListActive() != NIL + IF oGetList != NIL IF oGet != NIL - __GetListActive():oGet := oGet + oGetList:oGet := oGet ENDIF - RETURN __GetListActive():GetPreValidate() + RETURN oGetList:GetPreValidate() ENDIF RETURN .F. FUNCTION GetPostValidate( oGet ) + LOCAL oGetList := __GetListActive() - IF __GetListActive() != NIL + IF oGetList != NIL IF oGet != NIL - __GetListActive():oGet := oGet + oGetList:oGet := oGet ENDIF - RETURN __GetListActive():GetPostValidate() + RETURN oGetList:GetPostValidate() ENDIF RETURN .F. @@ -142,64 +146,70 @@ FUNCTION ReadInsert( lInsert ) RETURN Set( _SET_INSERT, lInsert ) FUNCTION ReadUpdated( lUpdated ) + LOCAL oGetList := __GetListActive() - IF __GetListActive() != NIL - IF PCount() > 0 - RETURN __GetListActive():ReadUpdated( lUpdated ) + IF oGetList != NIL + IF PCount() >= 1 + RETURN oGetList:ReadUpdated( lUpdated ) ELSE - RETURN __GetListActive():ReadUpdated() + RETURN oGetList:ReadUpdated() ENDIF ENDIF RETURN .F. FUNCTION Updated() + LOCAL oGetList := __GetListActive() - IF __GetListActive() != NIL - RETURN __GetListActive():lUpdated + IF oGetList != NIL + RETURN oGetList:lUpdated ENDIF RETURN .F. FUNCTION ReadKill( lKill ) + LOCAL oGetList := __GetListActive() - IF __GetListActive() != NIL - IF PCount() > 0 - RETURN __GetListActive():KillRead( lKill ) + IF oGetList != NIL + IF PCount() >= 1 + RETURN oGetList:KillRead( lKill ) ELSE - RETURN __GetListActive():KillRead() + RETURN oGetList:KillRead() ENDIF ENDIF RETURN .F. PROCEDURE __KillRead() + LOCAL oGetList := __GetListActive() - IF __GetListActive() != NIL - __GetListActive():KillRead( .T. ) + IF oGetList != NIL + oGetList:KillRead( .T. ) ENDIF RETURN PROCEDURE __SetFormat( bFormat ) + LOCAL oGetList := __GetListActive() - IF __GetListActive() != NIL + IF oGetList != NIL IF ISBLOCK( bFormat ) - __GetListActive():SetFormat( bFormat ) + oGetList:SetFormat( bFormat ) ELSE - __GetListActive():SetFormat() + oGetList:SetFormat() ENDIF ENDIF RETURN FUNCTION ReadFormat( bFormat ) + LOCAL oGetList := __GetListActive() - IF __GetListActive() != NIL - IF PCount() > 0 - RETURN __GetListActive():SetFormat( bFormat ) + IF oGetList != NIL + IF PCount() >= 1 + RETURN oGetList:SetFormat( bFormat ) ELSE - RETURN __GetListActive():SetFormat() + RETURN oGetList:SetFormat() ENDIF ENDIF diff --git a/harbour/source/vm/cmdarg.c b/harbour/source/vm/cmdarg.c index 6023cfb8c7..8617a475b2 100644 --- a/harbour/source/vm/cmdarg.c +++ b/harbour/source/vm/cmdarg.c @@ -323,7 +323,7 @@ void hb_cmdargProcessVM( void ) #endif hb_conOutErr( hb_conNewLine(), 0 ); - hb_conOutErr( "CA-Clipper 5.3x extensions: ", 0 ); + hb_conOutErr( "CA-Clipper 5.3x compatible extensions: ", 0 ); #if defined( HB_COMPAT_C53 ) hb_conOutErr( "Yes", 0 ); #else @@ -331,7 +331,7 @@ void hb_cmdargProcessVM( void ) #endif hb_conOutErr( hb_conNewLine(), 0 ); - hb_conOutErr( "Alaska Xbase++ extensions: ", 0 ); + hb_conOutErr( "Alaska Xbase++ compatible extensions: ", 0 ); #if defined( HB_COMPAT_XPP ) hb_conOutErr( "Yes", 0 ); #else @@ -339,7 +339,7 @@ void hb_cmdargProcessVM( void ) #endif hb_conOutErr( hb_conNewLine(), 0 ); - hb_conOutErr( "CA-Visual Objects extensions: ", 0 ); + hb_conOutErr( "CA-Visual Objects compatible extensions: ", 0 ); #if defined( HB_COMPAT_VO ) hb_conOutErr( "Yes", 0 ); #else