Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP 6.0 SaveAsClass - Header, Column,Page
Message
From
07/10/1998 09:40:34
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
05/10/1998 17:50:10
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00143459
Message ID:
00144550
Views:
41
>>I've done it for the OptionGroup - here's the code:
>
>I was looking for a generic way to copy all property values from one object to the other. I came up with a solution, keep following the thread.

Don't have the code at hand, but in the part where it copies properties from old control to the new one, we could build an array of properties, and play with PemStatus() of any of them, and actually copy the non-default ones to the new control. I've done this once for reporting purposes only, but the logic may be extended to copying. Beware of properties like Parent and such, which may be object references - they may lead into wilderness :). This reporting code looked like this:

oso=AMEMBERS(ovaj, _objekat, 1)
for o=1 to oso
do case
* if it's an object member, never mind
case ovaj(o,2)="Object"
case ovaj(o,2)="Event"
* read/WriteMethod here if necessary, though it wouldn't work at runtime, I think - should be done at class level
case ovaj(o,2)="Method"
case ovaj(o,2)="Property"
osob=ovaj(o,1)
* now if a property is different from default
if sys(1269, _objekat, osob, 0)
_text=ptxt
TheProperty=getpem(_objekat, osob)

Aftre this all we have to do is to assign this property to the copy of the control. It would take some Eval() at least, but it's feasible.

This code excerpt was written using recycled bytes.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform