Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Storing states of objects
Message
From
01/10/2001 07:58:58
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
01/10/2001 07:55:19
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00562427
Message ID:
00562440
Views:
19
>>>Hi,
>>>does anybody know if and how it's possible to store an entire object created with createobject() in a database to be retrieved later?
>>>The idea is that I can restore an earlier situation and work right on from there.
>>>
>>>TIA ET
>>
>>With AMEMBERS() you can get an array for all the properties. Write a loop to check all rows in the array where the second column = "Property" (AMEMBERS() also collects events and methods), and write them to disk in a suitable format. That latter part may turn out to be the real challenge, 'cause a memo-type property may contain embedded line-breaks, quotation marks, etc. It is probably safest to write each property into a separate memo field.
>>
>>Regards, Hilmar.
>
>If you make an array that holds the property name and the property value (columns), then you could do a
>save to memo memoname all like arrayname
>
>makes it a bit more flexible

I forgot about save to memo.

I think this is better than the solution I proposed. Mainly, it is much easier than writing a loop, and allows you to save everything into a single memo field.

Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform