Logo

Hacker’s Guide to Visual FoxPro
An irreverent look at how Visual FoxPro really works. Tells you the inside scoop on every command, function, property, event and method of Visual FoxPro.

RESTORE WINDOW, SAVE WINDOW

One of the mutant branches of the Xbase evolution toward windows management that died a fitting death along the way. Retained in Visual FoxPro for “backward compatibility.”

Usage

RESTORE WINDOW Window1 [,Window2 [, ... ] ] | ALL
        FROM MEMO MemoField | FileName
SAVE WINDOW Window1 [,Window2 [, ... ] ] | ALL
        TO MEMO MemoField | FileName

These commands let you save and restore a series of window definitions to either a file or a memo field. The definitions are stored in incomprehensible, undocumentable (and undocumented) binary format. The filename has a WIN extension, unless a different extension is specified. Although we could see the advantage of this method in order to allow users to customize their environment to meet their needs, we have never actually seen this method succeed in an application. With the fine control available in form events such as Resize and Move, we feel that custom methods to save and restore the Top, Left, Height and Width properties have far more chance of succeeding than the use of these commands.

Example

SAVE WINDOW Form1 to Form1
RESTORE WINDOW Form1 FROM Form1

See Also

Move, Resize, Restore From, Save To