Updating ADS RDD files

This commit is contained in:
Alexander S.Kresin
2000-02-20 20:07:41 +00:00
parent 60b1bd6adb
commit bd749549fe
3 changed files with 56 additions and 26 deletions

View File

@@ -1,3 +1,9 @@
20000220-23:05 GMT+3 Alexander Kresin
* contrib/rdd_ads/ads1.c
* memo handling changed - proposal of Brian Hays
* contrib/rdd_ads/ads1.c
* improvement of AdsKeyNo() and AdsKeyCount()
20000220-19:55 GMT+3 Alexander Kresin
* source/pp/stdalone/hbpp.c
* source/pp/hbppint.c

View File

@@ -434,16 +434,22 @@ static ERRCODE adsGetValue( ADSAREAP pArea, USHORT uiIndex, PHB_ITEM pItem )
UNSIGNED32 pulLen;
AdsGetFieldName( pArea->hTable, uiIndex, szName, &pusBufLen );
AdsGetMemoLength( pArea->hTable, szName, &pulLen );
if( pulLen > 0 )
{
pucBuf = (UNSIGNED8*) hb_xgrab( pulLen );
AdsGetString( pArea->hTable, szName, pucBuf, &pulLen, ADS_NONE );
hb_itemPutCL( pItem, ( char * ) pucBuf, pulLen );
hb_xfree( pucBuf );
}
if ( AdsGetMemoLength( pArea->hTable, szName, &pulLen ) ==
AE_NO_CURRENT_RECORD )
hb_itemPutC( pItem, "" );
else
hb_itemPutC( pItem, "" );
{
if( pulLen > 0 )
{
pulLen++; // make room for NULL
pucBuf = (UNSIGNED8*) hb_xgrab( pulLen );
AdsGetString( pArea->hTable, szName, pucBuf, &pulLen, ADS_NONE );
hb_itemPutCL( pItem, ( char * ) pucBuf, pulLen );
hb_xfree( pucBuf );
}
else
hb_itemPutC( pItem, "" );
}
break;
}

View File

@@ -117,7 +117,7 @@ HARBOUR HB_ADSSETDEFAULT( void )
HARBOUR HB_ADSSETDELETED( void )
{
UNSIGNED16 usShowDeleted = hb_parl( 1 );
AdsShowDeleted( usShowDeleted ? 0 : 1 );
AdsShowDeleted( usShowDeleted );
}
HARBOUR HB_ADSBLOB2FILE( void )
@@ -181,18 +181,31 @@ HARBOUR HB_ADSKEYNO( void )
pArea = (ADSAREAP) hb_rddGetCurrentWorkAreaPointer();
if( pArea )
{
if( ISNUM( 1 ) )
{
ordNum = hb_parni( 1 );
AdsGetIndexHandleByOrder( pArea->hTable, ordNum, &hIndex );
if( hb_pcount() > 0 )
{
if( ISNUM( 1 ) )
{
ordNum = hb_parni( 1 );
AdsGetIndexHandleByOrder( pArea->hTable, ordNum, &hIndex );
}
else
{
ordName = hb_parc( 1 );
AdsGetIndexHandle( pArea->hTable, ordName, &hIndex );
}
AdsGetKeyNum ( hIndex, ADS_IGNOREFILTERS, &pulKey);
}
else
{
ordName = hb_parc( 1 );
AdsGetIndexHandle( pArea->hTable, ordName, &hIndex );
if( pArea->hOrdCurrent != 0)
{
hIndex = pArea->hOrdCurrent;
AdsGetKeyNum ( hIndex, ADS_IGNOREFILTERS, &pulKey);
}
else
AdsGetRecordNum ( pArea->hTable, ADS_IGNOREFILTERS, &pulKey);
}
AdsGetKeyNum ( hIndex, ADS_IGNOREFILTERS, &pulKey);
hb_retnl( pulKey );
}
else
@@ -210,20 +223,25 @@ HARBOUR HB_ADSKEYCOUNT( void )
pArea = (ADSAREAP) hb_rddGetCurrentWorkAreaPointer();
if( pArea )
{
if( ISNUM( 1 ) )
if( hb_pcount() > 0 )
{
ordNum = hb_parni( 1 );
AdsGetIndexHandleByOrder( pArea->hTable, ordNum, &hIndex );
if( ISNUM( 1 ) )
{
ordNum = hb_parni( 1 );
AdsGetIndexHandleByOrder( pArea->hTable, ordNum, &hIndex );
}
else
{
ordName = hb_parc( 1 );
AdsGetIndexHandle( pArea->hTable, ordName, &hIndex );
}
}
else
{
ordName = hb_parc( 1 );
AdsGetIndexHandle( pArea->hTable, ordName, &hIndex );
}
hIndex = (pArea->hOrdCurrent == 0)? pArea->hTable:pArea->hOrdCurrent;
AdsGetKeyCount ( hIndex, ADS_IGNOREFILTERS, &pulKey);
AdsGetRecordCount ( hIndex, ADS_IGNOREFILTERS, &pulKey);
hb_retnl( pulKey );
}
else
hb_errRT_DBCMD( EG_NOTABLE, 2001, NULL, "ADSKEYCOUNT" );
}
}