|
From: Micha N. <md...@us...> - 2004-08-23 20:46:00
|
Update of /cvsroot/tdbf/tdbf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31279 Modified Files: dbf_idxfile.pas history.txt Log Message: fixed: recursive loop in setrange Index: history.txt =================================================================== RCS file: /cvsroot/tdbf/tdbf/history.txt,v retrieving revision 1.67 retrieving revision 1.68 diff -C2 -d -r1.67 -r1.68 *** history.txt 23 Aug 2004 19:13:26 -0000 1.67 --- history.txt 23 Aug 2004 20:45:48 -0000 1.68 *************** *** 57,60 **** --- 57,62 ---- - fixed: AV when checking empty binary fields - fixed: better foxpro header writing, fieldoffset, tabletype and headersize + **Version .1: + - fixed: recursive loop in setrange Index: dbf_idxfile.pas =================================================================== RCS file: /cvsroot/tdbf/tdbf/dbf_idxfile.pas,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** dbf_idxfile.pas 23 Aug 2004 18:03:11 -0000 1.3 --- dbf_idxfile.pas 23 Aug 2004 20:45:47 -0000 1.4 *************** *** 349,352 **** --- 349,354 ---- procedure First; procedure Last; + function WalkPrev: boolean; + function WalkNext: boolean; function Next: Boolean; function Prev: Boolean; *************** *** 3157,3161 **** // in FUserKey, it is because we have called Find repeat ! Result := Next; until not Result or (MatchKey(Key) <> 0); end else --- 3159,3163 ---- // in FUserKey, it is because we have called Find repeat ! Result := WalkNext; until not Result or (MatchKey(Key) <> 0); end else *************** *** 3398,3402 **** if Result then begin ! Result := Prev; if not Result then begin --- 3400,3404 ---- if Result then begin ! Result := WalkPrev; if not Result then begin *************** *** 3407,3411 **** // not found -> EOF found, go EOF, then to last record Last; ! Prev; end; // set upper bound --- 3409,3413 ---- // not found -> EOF found, go EOF, then to last record Last; ! WalkPrev; end; // set upper bound *************** *** 3452,3461 **** end; ! function TIndexFile.Prev: Boolean; var curRecNo: Integer; begin - // resync in-mem tree with tree on disk - Resync(true); // save current recno, find different next! curRecNo := FLeaf.PhysicalRecNo; --- 3454,3461 ---- end; ! function TIndexFile.WalkPrev: boolean; var curRecNo: Integer; begin // save current recno, find different next! curRecNo := FLeaf.PhysicalRecNo; *************** *** 3466,3475 **** end; ! function TIndexFile.Next: Boolean; var curRecNo: Integer; begin - // resync in-mem tree with tree on disk - Resync(true); // save current recno, find different prev! curRecNo := FLeaf.PhysicalRecNo; --- 3466,3473 ---- end; ! function TIndexFile.WalkNext: boolean; var curRecNo: Integer; begin // save current recno, find different prev! curRecNo := FLeaf.PhysicalRecNo; *************** *** 3480,3483 **** --- 3478,3495 ---- end; + function TIndexFile.Prev: Boolean; + begin + // resync in-mem tree with tree on disk + Resync(true); + Result := WalkPrev; + end; + + function TIndexFile.Next: Boolean; + begin + // resync in-mem tree with tree on disk + Resync(true); + Result := WalkNext; + end; + function TIndexFile.GetKeyLen: Integer; begin |