# ADD PROPERTY Add Object Properties at Runtime

> Source: https://manual.pvxplus.com/directives/add-prop

## 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](https://manual.pvxplus.com/pxplus-user-guide/object-oriented-pxplus/introduction)** (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](https://manual.pvxplus.com/directives/def-class)  
[DROP CLASS Delete Class Definition](https://manual.pvxplus.com/directives/drop-class)  
[DROP OBJECT Delete Object](https://manual.pvxplus.com/directives/drop-object)  
[FUNCTION Declare Object Method](https://manual.pvxplus.com/directives/function)  
[LIKE Inherit Properties](https://manual.pvxplus.com/directives/like)  
[LOAD CLASS Pre-Load Class Definition](https://manual.pvxplus.com/directives/load-class)  
[LOCAL Designation of Local Data](https://manual.pvxplus.com/directives/local)  
[PROPERTY Declare Object Properties](https://manual.pvxplus.com/directives/property)  
[STATIC Add Local Properties at Runtime](https://manual.pvxplus.com/directives/static)  
[RENAME CLASS Change Name of Class](https://manual.pvxplus.com/directives/rename-class)  
[NEW( ) Create New Object](https://manual.pvxplus.com/functions/new)  
[REF( ) Control Reference Count](https://manual.pvxplus.com/functions/ref)
