| Directives |
|
| Format |
Where:
The HIDE option is a +PxPlus Exclusive (build 9182) |
||||||||||||||||||||||
| Description | The PROPERTY
directive is used in Object Oriented
Programming to declare the properties that
can be accessed by the application program. These
properties can be treated like any other variable in the
system and are accessible using the Apostrophe Operator. A property name can be followed by a GET label to define the location of the logic to call whenever the property is read in the application. With GET in place, the specified logic issues a RETURN value that returns the actual value of the property to the application. For example:
If the logic resides outside of the defining program, then the name of the program and entry point can be provided in quotes instead. |
||||||||||||||||||||||
| *Note* | If the logic
required to do a read is simply a formula, then it can be
inserted directly into the PROPERTY definition
clause using an equals sign
instead of using a subroutine and a GET declaration.
For Example:
|
||||||||||||||||||||||
| Specify
the SET label to intercept all
of the property updates. With SET in
place, the system calls the logic whenever the property
is being updated and passes it the value being set. For Example:
Like the GET option, an external program/entry point can be provided as in:
Where Invline contains:
Use the keyword ERR to prevent the user from being able to GET or SET a property following the GET or SET declaration.
If the property contains an object identifier to another object, specify the keyword OBJECT after the property name. When the object is deleted, ProvideX will use the REF( ) function against the object identifier to remove it (as long as it has no other references) as in:
When you delete an object whose class is Customer, then the system reduces the reference count of the object whose identifier is in File and, if it is no longer being referenced, deletes it as well. For defining properties for an object class that are not exposed to external applications, refer to the LOCAL Directive. |
|||||||||||||||||||||||
| See Also | Object
Oriented Programming 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/Assign Program File RENAME CLASS Change Name of Class STATIC Add Local Properties at Runtime NEW( ) Function REF( ) Function |