Directives 

ADD PROPERTY

Add Object Properties at Runtime

Format

ADD PROPERTY [ varlist ]
  
Where:

varlist

List of variables used within an object that will be added dynamically to the property list.

Description

In Object-Oriented Programming (OOP), the ADD PROPERTY directive is used to create new property within an instance object at runtime. Properties created using this directive are visible to both operations within an object and to outside code.

If a variable included in the varlist is already declared as STATIC, it will be converted into an externally accessible property.

Note:
Ensure that the ADD PROPERTY declaration occurs before the variables are used - static variables will only take effect on references that follow their declaration.

(The ADD PROPERTY directive was added in PxPlus v8.01.)

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
PROPERTY Declare Object Properties
STATIC Add Local Properties at Runtime
RENAME CLASS Change Name of Class
NEW( ) Create New Object
REF( ) Control Reference Count