mirror of
https://gitlab.com/freepascal.org/fpc/pas2js.git
synced 2025-04-22 19:09:40 +02:00
* Fix getrecno, needs a 1-based number
This commit is contained in:
parent
c4206f6d97
commit
6bf2506960
@ -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([]);
|
||||
|
Loading…
Reference in New Issue
Block a user