Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cloning Objects and Comparing
Message
From
29/03/2005 19:12:50
 
 
To
23/03/2005 10:04:48
Moacyr Zalcman
Independent Consultant
São Paulo, Brazil
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 7
OS:
Windows 2000 SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00998412
Message ID:
00999823
Views:
22
>I create object1 using [scatter to name object1] I'd like to copy( or clone) the object1 to object2, but I DON'T want to use
>[scatter to name object2]

You could use AMEMBERS to get properties into an array, then follow with CREATEOBJECT('Empty'), then iterate the array and use ADDPROPERTY() to build up the new object. But, I would be really tempted to use SCATTER twice instead. Why the reluctance?

>and after some operations I'd like to compare these objects.
>
>The function COMPOBJ doesn't work for me because if any property value is .NULL.
>it returns .f.

I just tried that in VFP 8 and it did not return false. Are you sure? I used this simple test:
CREATE CURSOR temp (fld1 C(10) NULL, fld2 I)
INSERT INTO temp VALUES (null, 1)
SCATTER NAME o1
SCATTER NAME o2
? COMPOBJ(o1, o2) && returns .T. even with NULL
-- Randy
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform