|
From: Micha N. <md...@us...> - 2004-08-18 09:01:34
|
Update of /cvsroot/tdbf/tdbf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21710 Modified Files: Dbf_IdxFile.pas history.txt Log Message: fixed: set physicalrecno to non-existing recno corrupts table (rep by luchop) Index: history.txt =================================================================== RCS file: /cvsroot/tdbf/tdbf/history.txt,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** history.txt 9 Aug 2004 16:48:16 -0000 1.55 --- history.txt 18 Aug 2004 09:01:20 -0000 1.56 *************** *** 45,48 **** --- 45,49 ---- - fixed: IndexFile.PrepareKey numeric index: encode value zero to have no digits - added: TDbf.PrepareKey for conversion of key to numeric index key format + - fixed: set physicalrecno to non-existing recno corrupts table (rep by luchop) Index: Dbf_IdxFile.pas =================================================================== RCS file: /cvsroot/tdbf/tdbf/Dbf_IdxFile.pas,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** Dbf_IdxFile.pas 3 Aug 2004 16:17:23 -0000 1.61 --- Dbf_IdxFile.pas 18 Aug 2004 09:01:19 -0000 1.62 *************** *** 3314,3327 **** procedure TIndexFile.SetPhysicalRecNo(RecNo: Integer); begin ! // read buffer of this RecNo ! TDbfFile(FDbfFile).ReadRecord(RecNo, TDbfFile(FDbfFile).PrevBuffer); ! // extract key ! FUserKey := ExtractKeyFromBuffer(TDbfFile(FDbfFile).PrevBuffer); ! // translate to a search key ! if KeyType = 'C' then ! TranslateToANSI(FUserKey, FUserKey); ! // find this key ! FUserRecNo := RecNo; ! FindKey(false); end; --- 3314,3331 ---- procedure TIndexFile.SetPhysicalRecNo(RecNo: Integer); begin ! // check record actually exists ! if TDbfFile(FDbfFile).IsRecordPresent(RecNo) then ! begin ! // read buffer of this RecNo ! TDbfFile(FDbfFile).ReadRecord(RecNo, TDbfFile(FDbfFile).PrevBuffer); ! // extract key ! FUserKey := ExtractKeyFromBuffer(TDbfFile(FDbfFile).PrevBuffer); ! // translate to a search key ! if KeyType = 'C' then ! TranslateToANSI(FUserKey, FUserKey); ! // find this key ! FUserRecNo := RecNo; ! FindKey(false); ! end; end; |