Export (0) Print
Expand All
Expand Minimize
0 out of 1 rated this helpful - Rate this topic

RESTORE FROM Command

Retrieves variables and variable arrays saved in a variable file or a memo field and places them into memory.


RESTORE FROM FileName | MEMO MemoFieldName   [ADDITIVE]

Parameters

FileName

Specifies the variable file from which the variables and arrays are restored. Variable files are assigned a .mem extension.

MEMO MemoFieldName

Specifies the memo field from which variables and arrays are restored.

ADDITIVE

Prevents any variables or arrays currently in memory from being erased. If the number of variables or arrays being added with ADDITIVE plus the number of existing variables exceeds the variable limit, Microsoft Visual FoxPro brings as many variables and arrays as possible into memory from the variable file or memo field.

If you restore a variable or array that has the same name as an existing variable or array, the value in the existing variable or array is overwritten with the value of the restored variable or array.

When RESTORE FROM is issued in a program, all PUBLIC and PRIVATE variables and arrays are restored as PRIVATE; all LOCAL variables and arrays are restored as LOCAL. If RESTORE is issued in the Command window, PUBLIC and PRIVATE variables and arrays are restored as PUBLIC; LOCAL variables and arrays are restored as LOCAL.

RESTORE FROM clears any variables or arrays currently in memory unless you include the ADDITIVE keyword. RESTORE FROM does not affect system variables.

Note that object type variables cannot be restored from a variable file or memo field.

In the following example, two variables are created. They are saved to a variable file and restored without clearing the existing variables.

gnVal1 = 50
gcVal2 = 'Hello'
SAVE TO temp
CLEAR MEMORY

gdVal3 = DATE( )
RESTORE FROM temp ADDITIVE
CLEAR
DISPLAY MEMORY LIKE g*
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.