173
LIKE Directive
Inherit Properties
Format
LIKE "otherclass", "otherclass", ...
Where:
otherclass
Name of a class to inherit properties from.
Description
The LIKE directive is used in Object Oriented Programming (OOP) to inherit the
properties from one or more other classes. All properties and methods are inherited
from the specified classes.
When multiple occurrences of the same property/function are found within the
inheritance, the first class declared in the LIKE directive takes precedence.
Example
DEF CLASS "Company"
FUNCTION Delete()
REMOVE (fileno, KEY=COMP_ID$)
RETURN 1
END DEF
DEF CLASS "Client" FUNCTION Delete()
IF AMT_OWING <> 0 RETURN 0
REMOVE (fileno, KEY=CUST_ID$)
RETURN 1
END DEF
DEF CLASS "Dealer"
LIKE "Client", "Company"
END DEF
The Dealer class of objects would use the "Client" 'Delete() method, since it
was declared first.
See Also