ResetToDefault

This method was added in version 3.0b, probably because people were so disappointed it wasn't in the original version. It lets you do in code at either runtime or design-time what the "Reset to Default" option on the right-click menu of the Property Sheet does—restore a property or method that's been changed so it inherits from its parent class.

Usage

oObject.ResetToDefault( cPEM )
This method provides a programmatic way to restore a property or method to its default value. This is important because, otherwise, that PEM can't inherit from higher in the class hierarchy. Assigning the default value is not the same as restoring it.For properties, ResetToDefault works at design-time and runtime. The property is reset to the default for the class on which the object is based. At runtime, this means any changes that have occurred since the object was instantiated are discarded. At design-time, it means going one level up the class hierarchy and restoring that value. For methods, ResetToDefault works only at design-time. This seems reasonable to us—since you can't change code at runtime, what would restoring the default mean?This method makes writing builders and other developer tools much easier. One warning: If the object doesn't have the specified property, you get an error message. Use PEMStatus() first to ensure that the property applies to the specified object.

Example

IF PEMSTATUS(oObject, "BackColor", 5)
   * It exists
   oObject.ResetToDefault("BackColor")
ENDIF

See Also

GetPEM(), PEMStatus()


Back to Table of Contents

Copyright © 2002-2018 by Tamar E. Granor, Ted Roche, Doug Hennig, and Della Martin. Click for license .