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
|
Back to Table of Contents
Copyright © 2002-2018 by Tamar E. Granor,
Ted Roche, Doug Hennig, and Della Martin. Click for license
.