* Fix getrecno, needs a 1-based number

This commit is contained in:
michael 2018-05-10 10:41:06 +00:00
parent c4206f6d97
commit 6bf2506960

View File

@ -456,7 +456,7 @@ Var
begin
bkmIdx:=Integer(ActiveBuffer.bookmark);
Result:=FCurrentIndex.FindRecord(bkmIdx);
Result:=FCurrentIndex.FindRecord(bkmIdx)+1;
end;
procedure TBaseJSONDataSet.InternalInitFieldDefs;
@ -816,7 +816,7 @@ end;
procedure TBaseJSONDataSet.SetRecNo(Value: Integer);
begin
if (Value < 0) or (Value > FCurrentIndex.Count) then
if (Value < 1) or (Value > FCurrentIndex.Count) then
raise EJSONDataset.CreateFmt('%s: SetRecNo: index %d out of range',[Name,Value]);
FCurrent := Value - 1;
Resync([]);