Bug in FindKey with PartialKey
dbf ntx clipper compatibility delphi component
Brought to you by:
zilez20031
I found a bug using GotoNearest. The problem was in the implementation of FindKey I changed to this:
if c1 <= 0 then begin //Key + RecNo <= item.key + RecNo
if ( item.page <> 0 ) then begin
Result := Pass(item.page);
if Result then Exit;
end;
if c = 0 then begin // Key = item.key
if oB.AcceptTmpRecord(item.rec_no) then begin
iResult := item.rec_no;
Result := true;
Exit;
end;
end else begin
if SoftSeek (*add Naimi for GotoNearest *) or PartialKey (**) then begin
if oB.AcceptTmpRecord(item.rec_no) then begin
iResult := item.rec_no;
Result := true;
Exit;
end;
end else begin
Result := false;
Exit;
end;
end;
end;
Please provide the zipped sources of a sample application showing this.