Declaring the Class Field

From RAD Studio
Jump to: navigation, search

Go Up to Adding the Data Link


A component needs a field for each of its owned classes, as explained in Declaring the Class Fields. In this case, the calendar needs a field of type TFieldDataLink for its data link.

Declare a field for the data link in the calendar:

 type
   TDBCalendar = class(TSampleCalendar)
   private
     FDataLink: TFieldDataLink;
   .
   .
   .
   end;
 class PACKAGE TDBCalendar : public TSampleCalendar
 {
 private:
     TFieldDataLink *FDataLink;
     .
     .
     .
 };
 #include <DB.hpp>
 #include <DBTables.hpp>

Before you can compile the application, you need to add DB and DBCtrls to the unit's uses clause.

See Also