Hi, Przemek,

I've made fixed in my SVN copy, but I see you comment in ADSRDD code related to the subject, so, please verify, that fix is OK.


Index: C:/harbour/contrib/rddads/ads1.c
===================================================================
--- C:/harbour/contrib/rddads/ads1.c    (revision 13378)
+++ C:/harbour/contrib/rddads/ads1.c    (working copy)
@@ -1072,13 +1072,14 @@

          AdsAtEOF( pArea->hTable, &u16Eof );
          if( !u16Eof )
+            u32RetVal = AdsSkip( pArea->hOrdCurrent, -1 );
+         else
+            u32RetVal = AdsGotoBottom( pArea->hOrdCurrent );
+
+         if( u32RetVal != AE_SUCCESS )
          {
-            u32RetVal = AdsSkip( pArea->hOrdCurrent, -1 );
-            if( u32RetVal != AE_SUCCESS )
-            {
- commonError( pArea, EG_CORRUPTION, ( HB_ERRCODE ) u32RetVal, 0, NULL, EF_CANDEFAULT, NULL );
-               return HB_FAILURE;
-            }
+ commonError( pArea, EG_CORRUPTION, ( HB_ERRCODE ) u32RetVal, 0, NULL, EF_CANDEFAULT, NULL );
+            return HB_FAILURE;
          }
       }
    }


I also attach extended test code. It includes also test for the seeksoft/seeklast in the beginning of index.


Regards,
Mindaugas


REQUEST DBFCDX
#ifdef __HARBOUR__
REQUEST ADSCDX
#endif
FIELD F

PROC main(cADS, cLocal)
  IF EMPTY(cADS)
    RDDSETDEFAULT("DBFCDX")
  ELSE
#ifdef __HARBOUR__
    RDDSETDEFAULT("ADSCDX")
    AdsSetServerType(IIF(EMPTY(cLocal), 2, 1))
#endif
  ENDIF
  ? VERSION(), RDDSETDEFAULT()
  DBCREATE("test188", {{"F", "N", 5, 0}},, .T.)
  OrdCreate("test188", "f", "F", {|| F})
  DBAPPEND();  F := 1
  DBAPPEND();  F := 1
  DBAPPEND();  F := 3
  DBAPPEND();  F := 3
  DBSEEK(2, .T., .F.);  ? RECNO()
  DBSEEK(2, .T., .T.);  ? RECNO()
  DBSEEK(9, .T., .F.);  ? RECNO()
  DBSEEK(9, .T., .T.);  ? RECNO()
  DBSEEK(0, .T., .F.);  ? RECNO()
  DBSEEK(0, .T., .T.);  ? RECNO()
  DBCLOSEALL()
RETURN
_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to