From 0b3f153594abaa55bc4818650754b1ba4fccfdb5 Mon Sep 17 00:00:00 2001 From: Brian Hays Date: Thu, 24 May 2001 07:58:32 +0000 Subject: [PATCH] 2001-05-24 01:09 UTC-0800 Brian Hays --- harbour/ChangeLog | 14 ++++++++++++++ harbour/contrib/rdd_ads/ads.ch | 7 ++++++- harbour/contrib/rdd_ads/ads1.c | 1 + harbour/source/rdd/dbcmd.c | 20 ++++++++++++++++++++ 4 files changed, 41 insertions(+), 1 deletion(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 5188b1338c..0db8a5acd9 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,17 @@ +2001-05-24 01:09 UTC-0800 Brian Hays + + * source/rdd/dbcmd.c + * fixed dbSetIndex/ordListAdd to set the order and go top IF + it's the first bag + + * contrib/rdd_ads/ads.ch + + added #define ADS_LOCAL_SERVER, ADS_REMOTE_SERVER, + ADS_AIS_SERVER for "ORing" options + * fixed _SET_DELETED typo + + * contrib/rdd_ads/ads1.c + * Fixed EOF flag when doing a GO 0 + 2001-05-23 21:15 UTC-0800 Ron Pinkas * include/hbclass.ch ! Corrected few minor typos. diff --git a/harbour/contrib/rdd_ads/ads.ch b/harbour/contrib/rdd_ads/ads.ch index f06473abb6..110259d1d9 100644 --- a/harbour/contrib/rdd_ads/ads.ch +++ b/harbour/contrib/rdd_ads/ads.ch @@ -70,6 +70,11 @@ #command SET SERVER LOCAL => AdsSetServerType ( 1 ) #command SET SERVER REMOTE => AdsSetServerType ( 2 ) +/* Server type constants for ORing with AdsSetServerType() */ +#define ADS_LOCAL_SERVER 1 +#define ADS_REMOTE_SERVER 2 +#define ADS_AIS_SERVER 4 + #command SET AXS LOCKING ; => AdsLocking( if( upper( <(x)> ) == "ON", .t., .f. ) ) @@ -86,7 +91,7 @@ => Set( _SET_DELETED, <(x)> ) ; ;AdsSetDeleted( if( upper( <(x)> ) == "ON", .t., .f. ) ) #command SET DELETED () ; - => Set( _SET_DELE, ); AdsSetDeleted( ) + => Set( _SET_DELETED, ); AdsSetDeleted( ) #command SET EPOCH TO ; => Set( _SET_EPOCH, ); AdsSetEpoch( ) diff --git a/harbour/contrib/rdd_ads/ads1.c b/harbour/contrib/rdd_ads/ads1.c index d1cdd0146f..bb5e74d967 100644 --- a/harbour/contrib/rdd_ads/ads1.c +++ b/harbour/contrib/rdd_ads/ads1.c @@ -425,6 +425,7 @@ static ERRCODE adsGoTo( ADSAREAP pArea, ULONG ulRecNo ) else /* GoTo Phantom record */ { ulRecNo = 0; + AdsAtEOF( pArea->hTable, (UNSIGNED16 *)&(pArea->fEof) ); if ( !pArea->fEof ) ulRetVal = AdsGotoRecord( pArea->hTable, ulRecNo ); // don't do a GO 0 if already at EOF because we can't skip -1 off of it if you do diff --git a/harbour/source/rdd/dbcmd.c b/harbour/source/rdd/dbcmd.c index a58a85c5cb..fc5bde60df 100644 --- a/harbour/source/rdd/dbcmd.c +++ b/harbour/source/rdd/dbcmd.c @@ -2429,10 +2429,22 @@ HB_FUNC( ORDKEYNO ) HB_FUNC( ORDLISTADD ) { + DBORDERINFO pOrderInfo; + BOOL bFirst = FALSE; if( s_pCurrArea ) { + /* determine if there are existing orders; if not, this becomes the controlling order + */ + + pOrderInfo.itmResult = hb_itemPutNI( NULL, 0 ); + SELF_ORDINFO( ( AREAP ) s_pCurrArea->pArea, DBOI_ORDERCOUNT, &pOrderInfo ); + bFirst = ( pOrderInfo.itmResult->type & HB_IT_NUMERIC ) && + hb_itemGetNI( &pOrderInfo.itmResult ) != 0; + hb_itemRelease( pOrderInfo.itmResult ); + + pOrderInfo.atomBagName = hb_param( 1, HB_IT_STRING ); pOrderInfo.itmOrder = hb_param( 2, HB_IT_STRING ); if( !pOrderInfo.atomBagName ) @@ -2441,9 +2453,17 @@ HB_FUNC( ORDLISTADD ) return; } SELF_ORDLSTADD( ( AREAP ) s_pCurrArea->pArea, &pOrderInfo ); + if ( bFirst ) /* set as controlling order and go top */ + { + pOrderInfo.itmOrder = hb_itemPutNI( NULL, 1 ); + SELF_ORDLSTFOCUS( ( AREAP ) s_pCurrArea->pArea, &pOrderInfo ); + hb_itemRelease( pOrderInfo.itmOrder ); + SELF_GOTOP( ( AREAP ) s_pCurrArea->pArea ); + } } else hb_errRT_DBCMD( EG_NOTABLE, EDBCMD_NOTABLE, NULL, "ORDLISTADD" ); + } HB_FUNC( ORDLISTCLEAR )