| Directives |
|
| 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 DEF CLASS Define Object Class DROP CLASS Delete Class Definition DROP OBJECT Delete Object FUNCTION Declare Object Method LOAD CLASS Pre-Load Class Definition LOCAL Designation of Local Data PROGRAM Create/Assign Program File PROPERTY Declare Object Properties RENAME CLASS Change Name of Class STATIC Add Local Properties at Runtime NEW( ) Function REF( ) Function |
|