Progress
ADM 2 Guide
Get and Set Functions for Object Properties
A second mechanism that supports retrieving and setting property values is a naming convention that defines two groups of Progress functions called get and set functions. These functions are available for all properties that can be read or written by other objects:
- The get functions, which have the format getpropname, retrieve the values of properties. They take no input parameters and each returns the associated property value with the native data type. If a property is write only, no get function is available.
- The set functions, which have the format setpropname, set property values. They take as their only INPUT parameter the value of the associated property (which can be of any Progress data type) and each returns the type LOGICAL: TRUE or FALSE depending on whether the set operation was successful. If a property is read only, no set function is available.
If no special processing is needed to get or set a property, the get and set functions simply use the special include file syntax defined in the "ADMProps Temp–table and Object Properties" section to access the appropriate field in the properties temp–table record for the SmartObject. For example:
Note that the get and set functions are not restricted to such simple operations; they can perform whatever actions you need to in order to set and get values, such as verifying the validity of values. For example, you could use the following pair of functions to get and set the value of the BackGround Color property (BGColor) of the default Progress Frame in an object such as a SmartDataViewer:
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |