Define properties example
- Last Updated: May 24, 2019
- 1 minute read
- OpenEdge
- Version 13.0
- Documentation
Here is an example of some properties that are part of the Emp class definition. The Address property is defined as public, as are its accessors. So other parts of the application will be able to read and set the Address.
The PostalCode property is also defined as public, as are its accessors. The set accessor, however, has a placeholder for a custom implementation. You can add code here to transform a value for this property.
The JobTitle property is also defined as public, but only methods of this class can set its value. Other parts of the application can read this property, but cannot set its value.
class Enterprise.HR.Emp:
define public property Address as character no-undo
get.
set.
define public property PostalCode as character no-undo
get.
set(input arg as character):
// code to standardize the PostalCode
end set.
define public property JobTitle as character no-undo
get.
private set.
//rest of class definition....