Reputation: 17
I want solutions for RAD Studio 10.2 Berlin, same like in C++.
Inherit a record from another record (see following C++ example):
typedef struct A
{
virtual int ChangeName(const char* Name) = 0;
} A;
struct B : public A
{
virtual int ChangeValue(const char* Value) = 0;
};
How are pure virtual functions implemented in Delphi?
Upvotes: 0
Views: 308
Reputation: 613053
Record inheritance is not supported in the Delphi language.
The closest equivalent to a C++ pure virtual function in Delphi is an abstract virtual method. But there are no virtual methods in Delphi records because record inheritance is not supported in the Delphi language.
You can learn all this and more from the documentation. Some key excerpts:
- Records do not support inheritance.
...
- Virtual methods (those specified with the virtual, dynamic, and message keywords) cannot be used in record types.
Upvotes: 3