On Wed, 18 Mar 2009, Edmer wrote: Hi,
> Is this a confirmed bug ? > >> dbskip(0) will move the record pointer to phantom record (honoring the > >> scope). other RDDS don't do that It's cause by ADS behavior. > >> #include "ads.ch" > >> proc main() > >> rddregister( "ADS", 1 ) Not necessary from over 5 years, please remove this line from all you Harbour and xHarbouyr sopurce code. > >> rddsetdefault( "ADSCDX" ) > >> set server local > >> adslocking( .f. ) > >> adssetfiletype(ADS_CDX) It's not necessary if you are using ADSCDX, ADSNTX, ADT RDDs. adssetfiletype() is used only by "ADS" RDD for backward compatibility. As above, please remove it. > >> adslocking( .f. ) Repeated. Always try to no add any redundant code to examples or developers will have to look if it's not a reason of problem. > >> dbcreate("test.dbf",{ ; > >> {"tick" ,"n" , 10,0} }) > >> use test via "ADSCDX" excl > >> index on tick tag tick > >> ordscope(0, 100) > >> ordscope(1, 200 ) > >> ? rddname() > >> for lop := 1 to 10 > >> dbappend( .t. ) > >> //refresh buffer (server's trigger populated some fields) > >> dbskip( 0 ) Here new record is out of scope, dbSkip(0) is redirected to AdsSkip(0) functions which checks scopes and if record is out of the scope then it moves records to phantom record (EOF position). It's not Clipper compatible behavior but ADS work in such way. There are many others incompatibilities to Clipper in ADS though this one we can try to hide in our code if it's real problem. It enough to comment line 1154 in ads.c: AdsSkip( (pArea->hOrdCurrent) ? pArea->hOrdCurrent : pArea->hTable, 0 ); Just try. > >> //goto recn() //<----- this is ok > >> field->tick := 100 + lop Here you are updating phantom record so nothing is written to table. > >> ? field->tick ,eof() > >> next > >> browse() // looks like a corrupted index file , try browsing It's not corrupted but empty. I guess because I haven't try to execute this code. best regards, Przemek _______________________________________________ Harbour mailing list Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour