Restoring the Visual FoxPro Interactive Environment

If you want to close down all program operations and return Visual FoxPro to its interactive state, issue the following commands in order inside the Command window or in the program called just before you quit Visual FoxPro.

CLEAR ALL
CLOSE ALL
CLEAR PROGRAM

CLEAR ALL removes all objects from memory, which, in turn, closes all private data sessions and cursors.

CLOSE ALL, after CLEAR ALL has completed successfully, closes all databases, tables, and cursors in data session 1, the default Visual FoxPro data session.

CLEAR PROGRAM clears the compiled program buffer of the most recently executed programs. CLEAR PROGRAM forces Visual FoxPro to read the programs from disk, rather than from the program buffer.

Cleaning Up during Transactions   If transactions are in progress, use the END TRANSACTION Command for each level of transaction before issuing CLEAR ALL, CLOSE ALL, and CLEAR PROGRAM.

Cleaning Up during Buffered Updates   If buffered updates are in progress, use either the TABLEUPDATE( ) Function or TABLEREVERT( ) Function for each cursor with buffered updates before issuing CLEAR ALL, CLOSE ALL, and CLEAR PROGRAM.

See Also

Customizing the Visual FoxPro Environment | Setting Editor Options | CLEAR Commands | CLOSE Commands | END TRANSACTION Command | TABLEUPDATE( ) Function | TABLEREVERT( ) Function | Command Window | Operating the Command Window