ProvideX V8.20 > Language Reference > 2. Directives
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
Object Oriented Programming, p.21
DEF CLASS Define Object Class, p.64
DROP CLASS Delete Class Definition, p.101
DROP OBJECT Delete Object, p.103
FUNCTION Declare Object Method, p.136
LOAD CLASS Pre-Load Class Definition, p.194
LOCAL Designation of Local Data, p.196
PROGRAM Create/Assign Program File, p.257
PROPERTY Declare Object Properties, p.259
RENAME CLASS Change Name of Class, p.281
STATIC Add Local Properties at Runtime, p.327
NEW( ) Function, p.487
REF( ) Function, p.510