Restore session

<< Click to Display Table of Contents >>

Navigation:  Gekko User Manual > User manual introduction >

Restore session

Previous pageReturn to chapter overviewNext page

Gekko remembers statements from the previous interactive Gekko session. After the Gekko application has been closed and reopened, a line like the following allows old statements to be reloaded into the current input window (the "more" link points to the current help system page):

 

clip0115

 

The statements are stored in two versions:

 

Snapshot. The contents of the entire input window (the lower part of the main Gekko window) is stored as a snapshot.

History. The issued Gekko statements are stored/recorded as a chronological list of statements.

 

The difference between "snapshot" and "history" can be illustrated in the following way (using a freshly opened Gekko):

 

1.In the input window, type x = 2; followed by [Enter]. (Gekko will add the ; if omitted).

2.In line 2, type y = 2 * x; followed by [Enter].

3.In line 3, type x = 3; followed by [Enter].

4.Move the cursor two lines up to line 2 and issue the = 2 * x; line again with [Enter].

5.Move the cursor two lines down to line 4, and type prt y; followed by [Enter].

 

The output window will show y with the value 6 (we will think of x = 3 and y = 6 as the current "state" of Gekko). Try closing and reopening the Gekko application. When starting up, you should now see something like the following:

 

clip0113

 

If you click the "snapshot" link, the following lines will be put into the input window:

 

= 2;
= 2 * x;
= 3;
prt y;

 

This is a snapshot of how the input window looked when ending the previous Gekko session. If you mark all the statements (Ctrl+A) and run them with [Enter], the output window will show y with the value 4. So you cannot restore the exact previous state by issuing these snapshot statements in succession.

 

In contrast, the "history" link can restore the state. After clicking the "history" link, the following lines will be put into the input window:

 

= 2;
= 2 * x;
= 3;
= 2 * x;
prt y;

 

This is a chronological recording of the statements that were issued. If you mark all these statements (Ctrl+A) and run them with [Enter], the output window will show y with the value 6. In that sense, the "history" link permits reestablishing the state of Gekko, as it was when ending the previous Gekko session. Obviously, the first two lines of the above history can be (and should be) deleted, so sometimes the history may be longer than really needed to recreate the state. This is normal when using Gekko in an interactive way.

 

When restoring, sometimes it may be most practical to just recreate the input window as a snapshot like it was at the end of the previous session, and sometimes the history may be more useful to recreate the state of the program.

 

 

Details

 

Gekko stores snapshot and history in external files each time statement(s) are issued with [Enter] in the input window.

If Gekko crashes badly or becomes unresponsive, you should still be able to restore snapshot/history.

The history is recorded from when the Gekko application starts up. The history is cleared each time a RESET or RESTART statement is encountered, so that the history does not become unnecessarily long.

When the snapshot or history link is clicked, existing code in the input window is first cleared.

The statement history of the current session is generally available from the Gekko menu: Edit --> statement history... .

The files that store the restore info are called GekkoSnapshot.gcm and GekkoHistory.gcm. The location of these can be found in the Gekko menu: choose Help --> About... --> and see the path under "Temporary files".