Mike Sue-Ping
Cambridge, Ontario, Canada
Information générale
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Hi Mike.
>I've got to admit, Save to and Restore from are "ancient" and I've not used those commands for ages. Thanks for the code sample. I can make that work for me.
I used to use a similar approach but have since changed to using XML. The biggest reason is that the SAVE format is binary and more likely to suffer corruption (in my experience, anyway). Also, if you want to edit it in place (ie. right in the memo field using a BROWSE) for some reason, that's easily done with the XML.
You can use code very similar to Christof's but instead of saving the property values to individual variables, build an XML string instead with each element having the name of the property. To restore the object, go through the XML and set the properties accordingly.
Doug
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement