Access object properties
- Last Updated: January 17, 2024
- 2 minute read
- OpenEdge
- Version 12.8
- Documentation
A property typically defines and implements a GET and/or SET accessor,
which provides a class object instance with read and write access
to the property's data value, respectively. However, a property
can define a GET and/or SET accessor
without an implementation. In this case, the accessor reads the
value from or writes the value to the property’s default memory
(that is, a default storage area that holds the property’s current value).
At the very least, a property must define either a GET accessor
or a SET accessor in order to read or write the
property’s value.
If the property defines and implements a GET or SET accessor,
the accessor implementation executes implicitly. When you step into
code that reads or writes a property’s value, the Debugger steps
into the ABL code of that accessor implementation.
In certain cases, the code structure is such that errors occur when the
GET accessor implementation executes. This happens, for
example, if the implementation uses a buffer handle, and the Debugger executes the accessor
before the handle is assigned. To prevent this problem, you can disable the evaluation by the
Debugger of properties that have non-empty accessor methods. To do so, start the OpenEdge
Client session with the -noevalprops startup parameter. For
more information, see Startup Command and Parameter
Reference.
Consider the following Debugger behavior when examining and editing property values:
- If the property only defines a
GETorSETaccessor, and does not provide an implementation for the accessor, the Debugger reads the value from or writes the value to the property’s default memory. - If the property does not define a
GETaccessor, the Debugger cannot read the property’s value and displays "** Unavailable **" in the property’s Value cell. - If the property does not define a
SETaccessor, the Debugger cannot write the property’s value (the Value cell is read-only). - If the property defines only a
SETaccessor, and noGETaccessor, the Debugger can write the property’s value but will immediately display "** Unavailable **" in the property’s Value cell. - If you started the OpenEdge session with the
-noevalpropsstartup parameter, the Value cell displays "** Property evaluation disabled **" for those properties that have aGETmethod with an implementation. In this case, you can inspect the value of a property in the Dataview dialog box (see Dataview dialog box.) Note that ABL properties with emptyGETmethods are always evaluated.
GET or SET accessor,
the value of the property can change each time the Debugger reads
or writes the property because the accessor implementation will
execute each time, and its logic might change the property’s value.
For example, a property’s GET accessor might calculate
the property’s value based on the current time.