Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Restore Default Property Value
Message
 
 
To
13/04/2001 10:05:38
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00495250
Message ID:
00495275
Views:
11
>>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  && displays 27
ox.ResetToDefault('NewProperty')
? ox.NewProperty  && displays .F.
return

define class cusDefault as custom
   NewProperty = 25
   procedure Init
   THIS.NewProperty = 27
   endproc
enddefine
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform