Directives

RENAME CLASS

Change Name of Class

Format

RENAME CLASS old_name$ TO new_name$
 
Where:

old_name$

Previously defined class to be renamed.

new_name$

New name for the class.

TO

Mandatory keyword, not case sensitive.

Description

The RENAME CLASS directive is used in Object Oriented Programming (OOP) to alter the name of a previously defined class. This functionality allows the application designer to alter an existing object class easily without having to change programs.

See Also

DEF CLASS Define Object Class
DROP CLASS Delete Class Definition
DROP OBJECT Delete Object
FUNCTION Declare Object Method
LIKE Inherit Properties
LOAD CLASS Pre-Load Class Definition
LOCAL Designation of Local Data
PROGRAM Create or Assign Program File
PROPERTY Declare Object Properties
STATIC Add Local Properties at Runtime
NEW( ) Create New Object
REF( ) Control Reference Count

Example

If you had an existing application with a Product class object but needed to add a new field to the object such as Lot_Number:

rename class "Product" to "Orig_Product"
def class "Product"
like "Orig_Product"
property Lot_Number
end def

All subsequent uses of a Product class object would be identical now to the standard Product class and have the property Lot_Number.