>>Hi Bill,
>>
>>>Is it possible to programmatically restore a property's default value? E.g. in the IDE Property sheet we can right-click a property and select "Restore Default". Until now I had not given this any thought but I see no mechanism for doing this programmatically. Am I forgetting something?
>>>
>>How about the ResetToDefault method?
>
>Duh ... Good call. Thanks Bill. :-)
One thing to watch out for is using this method on user-defined properties. There really is no "default" value for user-defined properties. If you use ResetToDefault, you will end with the property being set to a logical .F..
Ex.
clear
ox = createobject('cusDefault')
? ox.NewProperty
ox.ResetToDefault('NewProperty')
? ox.NewProperty
return
define class cusDefault as custom
NewProperty = 25
procedure Init
THIS.NewProperty = 27
endproc
enddefine
Larry Miller
MCSD
LWMiller3@verizon.netAccumulate learning by study, understand what you learn by questioning. -- Mingjiao