>Hi guys,
>
>I have a class defined in a PRG, derived from Custom object with several user-defined properties.
>
>How I can make a method that I reset the value of each property with the value they had when you instantiate the class?
>
>I've tried
Object.ResetToDefault(Property), but to be user-defined properties, all take the value
.F.>
>I made a method instantiating a new object and copying the values of the properties defined by the user, although it works well, this is not to my liking.
Since it's all in a prg, and it's your custom class, you can simply have a method which will set the properties to whatever you want. You can then call that from the .init() and whenever you want. Something like
define class mycustom as custom
prop1=""
prop2=""
...
propX={}
procedure initProps()
with this
.prop1="something"
.prop2="whatever2"
...
.propX=date()
endwith
procedure init()
this.initProps()
Then later in code just lo.InitProps()