Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to store objects?
Message
 
 
À
20/02/1998 02:23:18
Roberto Cota Rivas
Quid Estrategia Esencial de México
Monterrey, Mexique
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00080035
Message ID:
00080238
Vues:
30
Wouldn't it be nice if VFP supported true object persistence? One trick that I've seen work:

- Use a property array to hold most of the data in your object. It can't hold other object references, just scalar data like strings, numerics, etc.
- To store that data: Do an Acopy(object.array, aTmp)
- Store to a memo field all like aTmp
- To Restore the data to the property array, just go the other way.

aTmp can be a local array, It only exists to serve as a conduit.

This technique will move data to and from disk pretty quickly because the transfer is being handled by very little interpreted code.

However, if you want to search your table based on the values of those stored object properties, you need a more granular approach
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform