2007-09-27 15:29 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/dbinfo.ch
* harbour/contrib/rdd_ads/ads1.c
* harbour/source/rdd/workarea.c
* harbour/source/rdd/delim1.c
* harbour/source/rdd/dbf1.c
* harbour/source/rdd/sdf1.c
+ added support for DBI_POSITIONED flag. Because some RDDs may not
support phantom record then checking for EOF() does not have to
be enough to detect that the cursor is positioned to phantom
record. Checking for RecNo() == LastRec() + 1 does not have to
work either because some RDD may use not use continuous record
numbers f.e. ADT. So in code like BROWSE() if you want to be sure
that current record is phantom one then (!dbInfo(DBI_POSITIONED))
should be used.
This commit is contained in:
@@ -8,6 +8,22 @@
|
||||
2002-12-01 13:30 UTC+0100 Foo Bar <foo.bar@foobar.org>
|
||||
*/
|
||||
|
||||
2007-09-27 15:29 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
|
||||
* harbour/include/dbinfo.ch
|
||||
* harbour/contrib/rdd_ads/ads1.c
|
||||
* harbour/source/rdd/workarea.c
|
||||
* harbour/source/rdd/delim1.c
|
||||
* harbour/source/rdd/dbf1.c
|
||||
* harbour/source/rdd/sdf1.c
|
||||
+ added support for DBI_POSITIONED flag. Because some RDDs may not
|
||||
support phantom record then checking for EOF() does not have to
|
||||
be enough to detect that the cursor is positioned to phantom
|
||||
record. Checking for RecNo() == LastRec() + 1 does not have to
|
||||
work either because some RDD may use not use continuous record
|
||||
numbers f.e. ADT. So in code like BROWSE() if you want to be sure
|
||||
that current record is phantom one then (!dbInfo(DBI_POSITIONED))
|
||||
should be used.
|
||||
|
||||
2007-09-27 14:40 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
|
||||
* harbour/contrib/rdd_ads/ads1.c
|
||||
* harbour/source/rdd/workarea.c
|
||||
|
||||
@@ -2710,6 +2710,10 @@ static ERRCODE adsInfo( ADSAREAP pArea, USHORT uiIndex, PHB_ITEM pItem )
|
||||
hb_itemPutL( pItem, pArea->fReadonly );
|
||||
break;
|
||||
|
||||
case DBI_POSITIONED:
|
||||
hb_itemPutL( pItem, pArea->fPositioned );
|
||||
break;
|
||||
|
||||
case DBI_LOCKCOUNT:
|
||||
{
|
||||
UNSIGNED16 u16Count;
|
||||
|
||||
@@ -286,6 +286,7 @@
|
||||
#define DBI_DECRYPT 141 /* Decrypt table */
|
||||
#define DBI_MEMOPACK 142 /* Pack memo file */
|
||||
#define DBI_DIRTYREAD 143 /* Get/Set index dirty read flag */
|
||||
#define DBI_POSITIONED 144 /* Is cursor positioned to valid record */
|
||||
|
||||
/* RECORD MAP (RM) support */
|
||||
#define DBI_RM_SUPPORTED 150 /* has WA RDD record map support? */
|
||||
|
||||
@@ -3273,6 +3273,10 @@ static ERRCODE hb_dbfInfo( DBFAREAP pArea, USHORT uiIndex, PHB_ITEM pItem )
|
||||
hb_itemPutL( pItem, pArea->fValidBuffer );
|
||||
break;
|
||||
|
||||
case DBI_POSITIONED:
|
||||
hb_itemPutL( pItem, pArea->fPositioned );
|
||||
break;
|
||||
|
||||
case DBI_ISENCRYPTED:
|
||||
hb_itemPutL( pItem, pArea->fTableEncrypted );
|
||||
break;
|
||||
|
||||
@@ -992,6 +992,10 @@ static ERRCODE hb_delimInfo( DELIMAREAP pArea, USHORT uiIndex, PHB_ITEM pItem )
|
||||
hb_itemPutL( pItem, pArea->fReadonly );
|
||||
break;
|
||||
|
||||
case DBI_POSITIONED:
|
||||
hb_itemPutL( pItem, pArea->fPositioned );
|
||||
break;
|
||||
|
||||
case DBI_DB_VERSION:
|
||||
case DBI_RDD_VERSION:
|
||||
{
|
||||
|
||||
@@ -743,6 +743,10 @@ static ERRCODE hb_sdfInfo( SDFAREAP pArea, USHORT uiIndex, PHB_ITEM pItem )
|
||||
hb_itemPutL( pItem, pArea->fReadonly );
|
||||
break;
|
||||
|
||||
case DBI_POSITIONED:
|
||||
hb_itemPutL( pItem, pArea->fPositioned );
|
||||
break;
|
||||
|
||||
case DBI_DB_VERSION:
|
||||
case DBI_RDD_VERSION:
|
||||
{
|
||||
|
||||
@@ -830,8 +830,20 @@ static ERRCODE hb_waInfo( AREAP pArea, USHORT uiIndex, PHB_ITEM pItem )
|
||||
}
|
||||
}
|
||||
hb_itemPutL( pItem, fScoped );
|
||||
break;
|
||||
}
|
||||
case DBI_POSITIONED:
|
||||
{
|
||||
ULONG ulRecCount, ulRecNo;
|
||||
if( SELF_RECNO( pArea, &ulRecNo ) != SUCCESS )
|
||||
return FAILURE;
|
||||
if( ulRecNo == 0 )
|
||||
hb_itemPutL( pItem, TRUE );
|
||||
else if( SELF_RECCOUNT( pArea, &ulRecCount ) != SUCCESS )
|
||||
return FAILURE;
|
||||
hb_itemPutL( pItem, ulRecNo != ulRecCount + 1 );
|
||||
break;
|
||||
}
|
||||
|
||||
case DBI_RM_SUPPORTED:
|
||||
hb_itemPutL( pItem, FALSE );
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user