2000-09-29 00:13 UTC+0800 Brian Hays <bhays@abacuslaw.com>

This commit is contained in:
Brian Hays
2000-09-29 07:14:13 +00:00
parent 300e9f43a2
commit f1b5b3c28f
4 changed files with 54 additions and 11 deletions

View File

@@ -1,3 +1,11 @@
2000-09-29 00:07 UTC+0800 Brian Hays <bhays@abacuslaw.com>
* contrib/rdd_ads/ads1.c
* source/rdd/dbcmd.c
* source/rtl/dummy.prg
* implemented ordKeyNo()
* fixed checkBofEof need to skipfilter without infinite loop
* ads1.c line 492 added (int) to clear warning re comparing different types
2000-09-29 09:50 GMT+3 Alexander Kresin <alex@belacy.belgorod.su>
* contrib/rdd_ads/ads1.c
* contrib/rdd_ads/adsfunc.c

View File

@@ -200,10 +200,12 @@ static ERRCODE hb_adsCheckBofEof( ADSAREAP pArea )
AdsAtBOF( pArea->hTable, (UNSIGNED16 *)&(pArea->fBof) );
AdsAtEOF( pArea->hTable, (UNSIGNED16 *)&(pArea->fEof) );
if( pArea->fBof && !pArea->fEof )
AdsSkip ( (pArea->hOrdCurrent) ? pArea->hOrdCurrent:pArea->hTable, 1 );
/* return SUPER_SKIPFILTER( (AREAP)pArea, 1 ); */
return SUCCESS;
if( pArea->fBof && !pArea->fEof )
{
AdsSkip ( (pArea->hOrdCurrent) ? pArea->hOrdCurrent:pArea->hTable, 1 );
return SUPER_SKIPFILTER( (AREAP)pArea, 1 );
}else
return SUCCESS;
}
ERRCODE adsCloseCursor( ADSAREAP pArea )
@@ -292,7 +294,6 @@ static ERRCODE adsGoTo( ADSAREAP pArea, ULONG ulRecNo )
pArea->fValidBuffer = FALSE;
AdsGotoRecord( pArea->hTable, ulRecNo );
hb_adsCheckBofEof( pArea );
// HB_TRACE(HB_TR_ALWAYS, ("afterCheckBE: %lu %lu ", pArea->ulRecNo, ulRecNo ));
return SUCCESS;
}
@@ -522,7 +523,7 @@ static ERRCODE adsGetValue( ADSAREAP pArea, USHORT uiIndex, PHB_ITEM pItem )
if( pArea->fEof )
{
int i;
for( i=0; i < pArea->maxFieldLen; i++ )
for( i=0; i < (int) pArea->maxFieldLen; i++ )
*( pBuffer+i ) = ' ';
*( pBuffer + ( int ) pField->uiLen ) = '\0';
}
@@ -596,7 +597,7 @@ static ERRCODE adsGetValue( ADSAREAP pArea, USHORT uiIndex, PHB_ITEM pItem )
UNSIGNED8 *pucBuf;
UNSIGNED32 pulLen;
if ( pArea->fEof ||
if ( pArea->fEof ||
AdsGetMemoLength( pArea->hTable, szName, &pulLen ) == AE_NO_CURRENT_RECORD )
hb_itemPutC( pItem, "" );
else
@@ -656,7 +657,6 @@ static ERRCODE adsPutValue( ADSAREAP pArea, USHORT uiIndex, PHB_ITEM pItem )
if( pArea->uiParents )
{
hb_adsCheckBofEof( pArea );
// xxx can't call this here-- it may skip!!!
}
if( uiIndex > pArea->uiFieldCount || pArea->fEof )
@@ -1316,6 +1316,17 @@ static ERRCODE adsOrderInfo( ADSAREAP pArea, USHORT uiIndex, LPDBORDERINFO pOrde
hb_itemPutNI(pOrderInfo->itmResult, usOrder);
break;
}
case DBOI_RECNO :
{
UNSIGNED32 pulKey ;
if( phIndex )
AdsGetKeyNum ( phIndex, ADS_RESPECTSCOPES, &pulKey);
else
AdsGetRecordNum ( pArea->hTable, ADS_IGNOREFILTERS, &pulKey);
hb_itemPutNL(pOrderInfo->itmResult, pulKey);
break;
}
}
return SUCCESS;
}

View File

@@ -2356,6 +2356,30 @@ HB_FUNC( ORDKEY )
hb_errRT_DBCMD( EG_NOTABLE, EDBCMD_NOTABLE, NULL, "ORDKEY" );
}
#ifdef HB_COMPAT_C53
HB_FUNC( ORDKEYNO )
{
DBORDERINFO pOrderInfo;
if( s_pCurrArea )
{
pOrderInfo.itmOrder = hb_param( 1, HB_IT_STRING );
if( !pOrderInfo.itmOrder )
pOrderInfo.itmOrder = hb_param( 1, HB_IT_NUMERIC );
pOrderInfo.atomBagName = hb_param( 2, HB_IT_STRING );
/* Either or both may be NIL */
pOrderInfo.itmResult = hb_itemPutNL( NULL, 0 );
SELF_ORDINFO( ( AREAP ) s_pCurrArea->pArea, DBOI_RECNO, &pOrderInfo );
hb_retnl( hb_itemGetNL( pOrderInfo.itmResult ) );
hb_itemRelease( pOrderInfo.itmResult );
}
else
hb_errRT_DBCMD( EG_NOTABLE, EDBCMD_NOTABLE, NULL, "ORDKEYNO" );
}
#endif
HB_FUNC( ORDLISTADD )
{
DBORDERINFO pOrderInfo;
@@ -3069,4 +3093,4 @@ HB_FUNC( DBFILEPUT )
hb_retl( FALSE );
}
#endif
#endif

View File

@@ -45,7 +45,7 @@ FUNCTION ordKeyAdd() ; RETURN .F.
FUNCTION ordKeyCount() ; RETURN 0
FUNCTION ordKeyDel() ; RETURN .F.
FUNCTION ordKeyGoto() ; RETURN .F.
FUNCTION ordKeyNo() ; RETURN 0
// FUNCTION ordKeyNo() ; RETURN 0
FUNCTION ordKeyVal() ; RETURN NIL
FUNCTION ordSetRelation() ; RETURN NIL
FUNCTION ordSkipUnique() ; RETURN .F.
@@ -69,4 +69,4 @@ FUNCTION __dbTotal() ; RETURN NIL
FUNCTION __dbFList() ; RETURN {}
FUNCTION __dbOpenSDF() ; RETURN NIL
FUNCTION __dbTrans() ; RETURN NIL
FUNCTION __dbTransRec() ; RETURN NIL
FUNCTION __dbTransRec() ; RETURN NIL