CLOSE

<< Click to Display Table of Contents >>

Navigation:  Gekko User Manual > Gekko statements >

CLOSE

Previous pageReturn to chapter overviewNext page

The CLOSE statement is used to close databanks in memory.

 

If the contents of the databank have been altered, these changes are written back til the databank file. This is often used in combination with open <editdatabank;, where the changes are later on saved to disk after a CLOSE databank;.

 


 

Syntax

 

close <SAVE=...> databanks;

 

SAVE=

With close <save=no>, Gekko will not write the databank to file, even if the databank contents has changed. See also open <save=no>.

databanks

The databank(s) to be closed. A star (*) indicates all open databanks opened by means of the OPEN statement (cf. also CLOSEALL). You may provide a list of banks like close db1, db2;

 

 


 

Example

 

Use this syntax to close a databank:

 

close mybank;

 

Closes databank 'mybank' (that has been opened by means of open mybank; and writes any changes to the databank back to the databank file).

 

close *;

 

Closes all databanks opened by means of the OPEN statement (and writes any changes to the databanks back to their databank files). After this, the Work databank will be in first position (Work cannot be closed).

 

To clear up the workspace, you may use:

 

close *; clear;
closeall;         //equivalent

 

If you issue close *; clear;, all opened databanks will be closed, Work will be in first position, and both Work and Ref are cleared (there is a shorter alias for these two statements, namely CLOSEALL). To reset the workspace entirely, see RESET/RESTART.

 

Close of a list of particular databanks (separate with commas):

 

close db1, db2;

 

 


 

Note

 

CLOSE cannot close Work or Ref databanks, and neither the Local or Global databanks. See the closely related OPEN statement.

 


 

Related statements

 

OPEN, CLEAR, CLOSEALL, DELETE