xHarbour Reference Documentation > Command Reference |
Loads dynamic memory variables from disk into memory.
RESTORE FROM <memFilename> [ADDITIVE]
The RESTORE command loads dynamic memory variables previously stored with the SAVE command from a memory file. The default extension for memory files is MEM.
Dynamic memory variables are PRIVATE and PUBLIC variables. Their symbolic names exist at runtime of an application. Thus, the symbolic names are re-created from a memory file with the RESTORE command. If dynamic variables of the same name are visible when the command is executed, they are overwritten with the values stored in the memory file. Variables that do not exist are created new as PRIVATE variables.
When the ADDITIVE clause is not specified, all currently existing dynamic variables are released befor the memory file is loaded.
GLOCBAL, LOCAL and STATIC variables are not affected by the RESTORE command.
See also: | GLOBAL, HB_DeSerialize(), LOCAL, PRIVATE, PUBLIC, RESTORE, STATIC |
Category: | Memory commands |
Source: | vm\memvars.c |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
// The example demonstrates saving and restoring of dynamic memory // variables. PROCEDURE Main PRIVATE cString1, cString2 PUBLIC dDate := Date() PUBLIC lLogic := .F. SAVE TO AllVars SAVE ALL LIKE c* TO StringVar SAVE ALL EXCEPT cString? TO SomeVars RELEASE ALL CLEAR MEMORY RESTORE FROM AllVars RESTORE FROM StringVar RESTORE FROM SomeVars RETURN
http://www.xHarbour.com