Command RESTORE Foundation
Reads memory variables from an XPF file.
RESTORE FROM <cVarFile> [ADDITIVE]
The command RESTORE FROM is identical in its functionality to the command with the same name in dBASE or Clipper. It does not, however, support the file format of MEM files. In Xbase++, memory variables are not saved in MEM files but in XPF files. This file format allows saving objects, arrays and code blocks on the hard disk as well as the conventional data types character, date, numeric and logical.
The command RESTORE copies into memory PRIVATE or PUBLIC variables which were previously written into an XPF file using the command SAVE. It also assigns the saved values. When the option ADDITIVE is not included, all PRIVATE and PUBLIC variables are first deleted. If ADDITIVE is used, the values from the file are assigned to variables of the same name if they exist at the time RESTORE is executed.
When no variable exists matching the variable name in the file when RESTORE is called, a PRIVATE variable of the same name is created. This variable has the same lifetime as the function or procedure within which the command RESTORE is executed. If a PUBLIC variable of the same name exists, it is assigned the value from the file. This variable, like all PUBLIC variables, remains after termination of the function or procedure which called the command RESTORE.
References to LOCAL and STATIC variables are resolved at compile time and are not affected by the command RESTORE. These variables cannot be saved with SAVE or read using RESTORE.
Restoring objects
If objects are stored in a file, the method :notifyLoaded() is executed automatically after RESTORE. This method is called only if it is implemented in a user defined class (see the second example).
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.