diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 4a44e8317b..ee940c9899 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,15 @@ +20000328-23:10 GMT+3 Alexander Kresin + * source/pp/ppcore.c + * Bug fixed, reported by Luiz Rafael Culik + * Problem solved with 16-bit version + * source/pp/pplib.c + * hb_pp_init() call removed from __preprocess() + * source/rdd/dbf1.c + * bug fixed as proposed Janica Lubos + * contrib/rdd_ads/ads.ch + * contrib/rdd_ads/adsfunc.c + * Added third optional parameter to adsKeyCount() as proposed Brian Hays + 2000-03-28 13:40 GMT+1 Maurilio Longo * include/hbdefs.h diff --git a/harbour/contrib/rdd_ads/ads.ch b/harbour/contrib/rdd_ads/ads.ch index f2e8b818a0..5d8629ed85 100644 --- a/harbour/contrib/rdd_ads/ads.ch +++ b/harbour/contrib/rdd_ads/ads.ch @@ -56,6 +56,11 @@ #define ADS_TOP 1 #define ADS_BOTTOM 2 +/* for calls that can optionally use filters */ +#define ADS_RESPECTFILTERS 1 +#define ADS_IGNOREFILTERS 2 +#define ADS_RESPECTSCOPES 3 + #command SET FILETYPE TO ; => AdsSetFileType( if( upper( <(x)> ) == "NTX", 1, ; if( upper( <(x)> ) == "CDX", 2, 3 ) ) ) diff --git a/harbour/contrib/rdd_ads/adsfunc.c b/harbour/contrib/rdd_ads/adsfunc.c index 6e1e970267..e1b2f0dd5e 100644 --- a/harbour/contrib/rdd_ads/adsfunc.c +++ b/harbour/contrib/rdd_ads/adsfunc.c @@ -220,6 +220,7 @@ HB_FUNC( ADSKEYCOUNT ) UNSIGNED8 ordNum; UNSIGNED32 pulKey; ADSHANDLE hIndex; + UNSIGNED16 usFilterOption = ADS_IGNOREFILTERS; pArea = (ADSAREAP) hb_rddGetCurrentWorkAreaPointer(); if( pArea ) @@ -239,8 +240,19 @@ HB_FUNC( ADSKEYCOUNT ) } else hIndex = (pArea->hOrdCurrent == 0)? pArea->hTable:pArea->hOrdCurrent; + if( hb_pcount() > 2 ) + { + if( ISNUM( 3 ) ) + usFilterOption = hb_parni( 3 ); + else + { + hb_errRT_DBCMD( EG_ARG, 1014, NULL, "ADSKEYCOUNT" ); + return; + } - AdsGetRecordCount ( hIndex, ADS_IGNOREFILTERS, &pulKey); + } + + AdsGetRecordCount ( hIndex, usFilterOption, &pulKey); hb_retnl( pulKey ); } else diff --git a/harbour/source/pp/ppcore.c b/harbour/source/pp/ppcore.c index 3047d88041..2eba79dc33 100644 --- a/harbour/source/pp/ppcore.c +++ b/harbour/source/pp/ppcore.c @@ -582,7 +582,14 @@ static void ParseCommand( char * sLine, BOOL com_or_xcom, BOOL com_or_tra ) HB_TRACE(HB_TR_DEBUG, ("ParseCommand(%s, %d, %d)", sLine, com_or_xcom, com_or_tra)); - NextWord( &sLine, cmdname, FALSE ); + HB_SKIPTABSPACES( sLine ); + ipos = 0; + while( *sLine != '\0' && *sLine != ' ' && *sLine != '\t' && *sLine != '<') + { + *(cmdname+ipos++) = *sLine++; + } + *(cmdname+ipos) = '\0'; + if( !ipos ) return; hb_strupr( cmdname ); HB_SKIPTABSPACES(sLine); @@ -2171,7 +2178,7 @@ void hb_pp_Stuff(char *ptri, char * ptro, int len1, int len2, int lenres ) { ptr1 = ptro + lenres; ptr2 = ptro + lenres + len1 - len2; - for( ; ptr1 >= ptro; ptr1--,ptr2-- ) *ptr2 = *ptr1; + for( i=0; i<=lenres; ptr1--,ptr2--,i++ ) *ptr2 = *ptr1; } else { diff --git a/harbour/source/pp/pplib.c b/harbour/source/pp/pplib.c index fccbcf06f3..60d6f64b2f 100644 --- a/harbour/source/pp/pplib.c +++ b/harbour/source/pp/pplib.c @@ -84,7 +84,7 @@ HB_FUNC( __PREPROCESS ) int slen; - hb_pp_Init(); + /* hb_pp_Init(); */ slen = HB_MIN( hb_parclen( 1 ), HB_PP_STR_SIZE - 1 ); memcpy( pText, hb_parc( 1 ), slen ); diff --git a/harbour/source/rdd/dbf1.c b/harbour/source/rdd/dbf1.c index a552fa9bd9..fe8edffe84 100644 --- a/harbour/source/rdd/dbf1.c +++ b/harbour/source/rdd/dbf1.c @@ -1133,6 +1133,8 @@ static ERRCODE dbfGoTo( AREAP pArea, ULONG ulRecNo ) return FAILURE; pArea->lpExtendInfo->ulRecCount = ulRecCount; } + else + ulRecCount = pArea->lpExtendInfo->ulRecCount; if( ulRecCount < 1 ) {