DELETE CONNECTION

Restore From, Save To

Allows the storage and retrieval of a series of memory variables to either a memo field or a file. Seems like a good idea, but has some limitations.

Usage

SAVE [ ALL LIKE VarSkeleton | ALL EXCEPT VarSkeleton ]         TO FileName | MEMO MemoField  RESTORE FROM FileName | MEMO MemoField [ ADDITIVE ]
SAVE and RESTORE allow specified memory variables to be stored into a memo field or a MEM file (the default extension, which can be overridden). This can be used to store a series of state variables or settings that can be restored at will. However, a few limitations apply. First, all variables are restored with private scope, regardless of their initial scope. Secondly, failure to use the ADDITIVE keyword results in the obliteration of all variables in memory.

The worst limitation we see, though, is that MEM files are difficult to read. The files and memo fields are stored in a binary format, which is a pain in the neck (though possible) to parse. Fixing a broken MEM file is not for the weak of heart. In addition, it can be really difficult to troubleshoot a problem where a MEM file clobbers existing variables.

We prefer to either store our settings to a DBF with predefined fields for each setting or use an INI file or the Registry to store free-form settings.

Example

SAVE TO MYARRAYS.MEM ALL LIKE LA* RESTORE FROM MYARRAYS ADDITIVE

See Also

INI Files, Registration Database


View Updates

Copyright © 2002 by Tamar E. Granor, Ted Roche, Doug Hennig, and Della Martin. All Rights Reserved.



Hacker's Guide to Visual FoxPro 7. 0
Hackers Guide to Visual FoxPro 7.0
ISBN: 1930919220
EAN: 2147483647
Year: 2001
Pages: 899

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net