Libraria, part 4
identicon
webmaster@cfcc0ed1
DISCUSSION OF ORIGIN

Administrator

identicon

See their activity.

webmaster@cfcc0ed1 Sunday 18th February 2018, 15:59

Libraria, part 4

Part 4 of our database tutorial is online:
Libraria - part 4

DISCUSSION OF ORIGIN
identicon
Bill Delphi

Administrator

identicon

See their activity.

Bill Delphi Sunday 18th February 2018, 16:02

In the steps for the source code, step 1 and step 2 give exactly the same lines of code: Grid1.Enabled := False; and so on...
Why not replace this lines of code with a procedure? The same for steps 3 and 4.
identicon
webmaster@cfcc0ed1

Administrator

identicon

See their activity.

webmaster@cfcc0ed1 Sunday 18th February 2018, 16:30

In the Object Inspector, next to the event BeforeEdit, you could replace cdsBooksBeforeEdit with cdsBooksBeforeEditInsert. This also changes the name of the event handler in the source code.

Also in the Object Inspector, delete the text next to BeforeInsert, click on the downward pointing arrow and select cdsBooksBeforeEditInsert. Now the two events will fire the same event handler.

But I advise against this, mainly because I want to modify the code later on in part 5 of the tutorial.
The same goes for the two cdsAfter... event handlers.
Suggested Topics View / Reply Forum
Jeff Beginner started Numbers in Delphi 1.5K / 1 CrashCourse
William started What is OOP? 2.3K / 1 General
Guido started Lazarus / Free Pascal Tutorials 688 / 0 News
webmaster@cfcc0ed1 started Libraria, part 5 1.3K / 0 Database