>function ocopy(toFrom,toTo) > local laFromProperties,lcPropertyName,lcCommand > * > * The idea is to copy all of the user defined properties from > * one object to another. It will overwrite system created properties that > * are user created properties in toFrom: e.g. > * A copied to B where B is say a listbox and A is a custom object. Background > * color is a VFP property in B but a user created copy in A. This function would > * copy the value. > > if vartype(toFrom)#"O" or isnull(toFrom) > * error > return .f. > endif > if vartype(toTo)#"O" or isnull(toTo) > * error > return .f. > endif > dimension laFromProperties(1) > =amembers(laFromProperties,toFrom) > > * > * loop through toFrom looking for developer defined properties > * copy the values to toTo > for each lcPropertyName in laFromProperties > if !pemstatus(toFrom,lcPropertyName,4) && VFP defined > loop > endif > if pemstatus(toTo,lcPropertyName,5) > lcCommand = "toTo."+lcPropertyName + " = toFrom." + lcPropertyName > &lcCommand > endif > endfor > > return .t. >endfunc >>>Hi all,
>>define class MyObject as container >> A="" >> B="" >> C="" >>enddefine >>>>