From fc22b231b1398a8e7f895079c250ebf9e4d7a942 Mon Sep 17 00:00:00 2001 From: "Alexander S.Kresin" Date: Fri, 18 Jan 2002 14:44:55 +0000 Subject: [PATCH] 2002-01-18 17:45 UTC+0300 Alexander Kresin --- harbour/ChangeLog | 4 ++++ harbour/source/rdd/dbfntx/dbfntx1.c | 21 ++++++++++++++++++--- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 3fbda5631d..8e0863ff98 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -7,6 +7,10 @@ For example: 2002-12-01 23:12 UTC+0100 Foo Bar */ +2002-01-19 13:39 UTC-0300 Horacio Roldan + * source/rdd/dbfcdx1.c + ! fixed a bug in descending skipping + + added support for ordKeyNo() and ordKeyCount() 2002-01-19 08:00 UTC+0700 Andi Jahja * source/rtl/typefile.prg diff --git a/harbour/source/rdd/dbfntx/dbfntx1.c b/harbour/source/rdd/dbfntx/dbfntx1.c index 8f46fc7088..7724732500 100644 --- a/harbour/source/rdd/dbfntx/dbfntx1.c +++ b/harbour/source/rdd/dbfntx/dbfntx1.c @@ -1723,7 +1723,7 @@ static BOOL hb_ntxReadBuf( NTXAREAP pArea, BYTE* readBuffer, USHORT* numRecinBuf static ERRCODE hb_ntxIndexCreate( LPNTXINDEX pIndex ) { - ULONG ulRecNo, ulRecCount, ulKeyNo = 0; + ULONG ulRecNo, ulRecCount, ulKeyNo = 0, lStep = 0; USHORT uiCurLen; char szBuffer[ HB_MAX_DOUBLE_LENGTH + 1 ]; NTXAREAP pArea; @@ -1826,8 +1826,23 @@ static ERRCODE hb_ntxIndexCreate( LPNTXINDEX pIndex ) printf( "ntxCreateOrder" ); } } - if( pArea->lpdbOrdCondInfo && !pArea->lpdbOrdCondInfo->fAll ) - SELF_SKIP( ( AREAP ) pArea, 1 ); + if( pArea->lpdbOrdCondInfo ) + { + if( !pArea->lpdbOrdCondInfo->fAll ) + SELF_SKIP( ( AREAP ) pArea, 1 ); + if( pArea->lpdbOrdCondInfo->lStep ) + { + lStep ++; + if( lStep == (ULONG) pArea->lpdbOrdCondInfo->lStep ) + lStep = 0; + } + if( pArea->lpdbOrdCondInfo->itmCobEval && !lStep ) + { + hb_vmPushSymbol( &hb_symEval ); + hb_vmPush( pArea->lpdbOrdCondInfo->itmCobEval ); + hb_vmDo( 0 ); + } + } } if( ulKeyNo < ulRecCount && ulKeyNo%2 ) hb_ntxSortKeyAdd( pTag, &sortInfo, NULL, ulKeyNo );