CLEAR

<< Click to Display Table of Contents >>

Navigation:  Gekko User Manual > Gekko statements >

CLEAR

Previous pageReturn to chapter overviewNext page

The CLEAR statement is used to clear databanks in memory (that is, delete all variables inside the databanks). If CLEAR is used without argument, the first-position and Ref databanks are cleared (but not, among other things, the Global or Local databanks). Se also CLOSEALL or RESET/RESTART. Use DELETE to delete individual variables.

 


 

Syntax

 

clear;
clear databank;
clear <FIRST REF>;

 

databank

The name of the databank (click F2 to see the list of databanks).

FIRST

Clears the first-position databank.

REF

Clears the Ref databank.

 


 

Examples (clearing databanks)

 

To clear a particular databank, use:

 

clear mybank;

 

In particular, you may clear the first-position and/or Ref databanks like this:

 

clear work; //assuming work is in first position
clear ref;

 

To clear both the first-position and Ref (reference) databanks, use CLEAR without arguments:

 

clear;

 

Alternatively, there are these variants:

 

clear<first>;

 

Clears the first-position databank (which is often Work), whereas

 

clear<ref>;

 

Clears the reference databank (which is always Ref).

 

 


 

Notes

 

To delete individual variables, use the DELETE statement. To clear the entire workspace, see the CLOSEALL, RESET and RESTART statements.

 

Since user functions, procedures or models do not live in databanks, CLEAR does not clear these. Use RESET/RESTART to that end. Also, CLEAR without arguments does not clear the Local or Global databanks.

 

 


 

Related statements

 

CLOSE, CLOSEALL, CLS, DELETE, RESET, RESTART