Skip to content

Commit

Permalink
feat: List all or list with paging
Browse files Browse the repository at this point in the history
  • Loading branch information
gcarreno committed May 17, 2022
1 parent 7cb283c commit 9141c9b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
4 changes: 4 additions & 0 deletions history.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# [2022-05-17] First Release v0.1.1

- List all or list with paging

# [2022-05-17] First Release v0.1

- Creates a database
Expand Down
6 changes: 2 additions & 4 deletions release-notes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# [2022-05-17] First Release v0.1
# [2022-05-17] First Release v0.1.1

- Creates a database
- Inserts some entries
- Lists the entries
- List all or list with paging
12 changes: 10 additions & 2 deletions src/forms/gnudbm.forms.main.pas
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ implementation

cVersionMajor = 0;
cVersionMinor = 1;
cVersion = '0.1';
cVersionBuild = 1;

cListAll = False;

{$R *.lfm}

Expand Down Expand Up @@ -194,6 +196,12 @@ procedure TfrmMain.actGDBMListExecute(Sender: TObject);
begin
Inc(index);
value:= gdbm_fetch(FDB, key);
if cListAll then
begin
memLog.Append(Format('%s - %s: %s', [FormatFloat(',0',index), key, value]));
Application.ProcessMessages;
end
else
if (index = 1) or (index mod cEntryPaging = 0) then
begin
memLog.Append(Format('%s - %s: %s', [FormatFloat(',0',index), key, value]));
Expand Down Expand Up @@ -234,7 +242,7 @@ procedure TfrmMain.FormCreate(Sender: TObject);
FInsertInProgress:= False;
FInsertDone:= False;

Caption:= Format('Test GDBM v%s', [cVersion]);
Caption:= Format('Test GDBM v%d.%d.%d', [cVersionMajor, cVersionMinor, cVersionBuild]);
edtDBFilename.Text:= cDefaultFilename;

InitShortcuts;
Expand Down

0 comments on commit 9141c9b

Please sign in to comment.