mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-14 11:09:41 +02:00
+ fcl-db/dbase: implemented FindFirst,FindNext,FindPrior,FindLast and associated tests
git-svn-id: trunk@24107 -
This commit is contained in:
parent
373ab729c7
commit
2569f52b73
@ -260,7 +260,11 @@ type
|
||||
procedure SetFieldData(Field: TField; Buffer: Pointer);
|
||||
{$ifdef SUPPORT_OVERLOAD} overload; {$endif} override; {virtual abstract}
|
||||
|
||||
{ virtual methods (mostly optionnal) }
|
||||
{ virtual methods (mostly optional) }
|
||||
function FindFirst: Boolean; override;
|
||||
function FindLast: Boolean; override;
|
||||
function FindNext: Boolean; override;
|
||||
function FindPrior: Boolean; override;
|
||||
function GetDataSource: TDataSource; {$ifndef VER1_0}override;{$endif}
|
||||
function GetRecordCount: Integer; override; {virtual}
|
||||
function GetRecNo: Integer; override; {virtual}
|
||||
@ -753,6 +757,30 @@ begin
|
||||
SetFieldData(Field, Buffer, true);
|
||||
end;
|
||||
|
||||
function TDbf.FindFirst: Boolean;
|
||||
begin
|
||||
// Use inherited function; if failed use FindRecord
|
||||
Result:=inherited FindFirst or FindRecord(True, True);
|
||||
end;
|
||||
|
||||
function TDbf.FindLast: Boolean;
|
||||
begin
|
||||
// Use inherited function; if failed use FindRecord
|
||||
Result:=inherited FindLast or FindRecord(True, False);
|
||||
end;
|
||||
|
||||
function TDbf.FindNext: Boolean;
|
||||
begin
|
||||
// Use inherited function; if failed use FindRecord
|
||||
Result:=inherited FindNext or FindRecord(False, True);
|
||||
end;
|
||||
|
||||
function TDbf.FindPrior: Boolean;
|
||||
begin
|
||||
// Use inherited function; if failed use FindRecord
|
||||
Result:=inherited FindPrior or FindRecord(False, False);
|
||||
end;
|
||||
|
||||
procedure TDbf.SetFieldData(Field: TField; Buffer: Pointer; NativeFormat: Boolean); {overload; override;}
|
||||
{$else}
|
||||
const
|
||||
@ -1299,7 +1327,7 @@ begin
|
||||
Result := 0;
|
||||
end;
|
||||
|
||||
function TDbf.GetLanguageStr: String;
|
||||
function TDbf.GetLanguageStr: string;
|
||||
begin
|
||||
if FDbfFile <> nil then
|
||||
Result := FDbfFile.LanguageStr;
|
||||
@ -2293,7 +2321,7 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TDbf.SetTableName(const s: string);
|
||||
procedure TDbf.SetTableName(const S: string);
|
||||
var
|
||||
lPath: string;
|
||||
begin
|
||||
|
@ -32,6 +32,7 @@ BUGS & WARNINGS
|
||||
|
||||
|
||||
FreePascal trunk:
|
||||
- implemented FindFirst,FindNext,FindPrior,FindLast
|
||||
- compile fix for FPC 2.6.2 (r24069), possibly useful for Delphi
|
||||
|
||||
------------------------
|
||||
|
@ -16,4 +16,6 @@ License is LGPL (Library General Public License); see COPYING.LIB for details.
|
||||
|
||||
Development notes/additions to end user documentation
|
||||
|
||||
property RecNo: approximate record number. Does not take deleted records into account. Used mainly in grids.
|
||||
property RecNo: approximate record number. Does not take deleted records into account. Used mainly in grids.
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user