GEKKO

<< Click to Display Table of Contents >>

Navigation:  Gekko User Manual > Gekko statements >

GEKKO

Previous pageReturn to chapter overviewNext page

Starting from Gekko 3.1.18, the GEKKO statement can be used to check if the currently running Gekko version is suitable regarding a particular Gekko program (.gcm file). For instance, you may be using some new functionality from Gekko 3.x.x, and in that case, the GEKKO command can check whether the Gekko version is >= 3.x.x or not. This provides a better feedback for the user rather than the .gcm file just crashes.

 

You may state a range of Gekko versions, and you may use Gekko version dates, too (the date corresponding to Gekko.exe of the running Gekko version). Checking the version date is mostly for beta-testers in between official Gekko (development) versions. If both a Gekko version and a Gekko date is indicated, the version number always trumps the date.

 

If the version check is ok, a brief message is printed. If not ok, Gekko will abort with an error.

 


 

Syntax

 

GEKKO VERSION operator arg arg ;

GEKKO VERSION operator arg arg  andOr VERSION  operator arg arg ;

 

 

operator

Choose between <, <=, ==, >=, >, or <>. Note that non-equality is <>, not !=.

arg

Arguments: either string (for a Gekko version number) or daily date (for a Gekko date).

andOr

(Optional). Can be either and or or.

 

 


 

Examples

 

To check that the running Gekko version is >= 3.1.18, use the following in your Gekko program:

 

gekko version >= '3.1.18';

 

Note that the Gekko version number is stated as a string: gekko version >= 3.1.18; will fail with a syntax error. A range of versions could be stated like this (note: Gekko 4.0 is not even planned as of August 2024):

 

gekko version >= '3.1.18' and version < '4.0';  //or just '4'

 

To check that the running Gekko version number is >= 3.1.18 and has a Gekko.exe with a date from at least 2024m4d4, (April 4th, 2024), use this:

 

gekko version >= '3.1.18' 2024m4d4;

 

Testing for dates is mostly for beta testers in between official versions. In general, it is best to include Gekko version numbers and not only use dates, because file systems, version control systems, etc. may tamper with file dates (like for instance the date of Gekko.exe).

 

 


 

Notes

 

If a gekko version check is invalid, Gekko will stop with an error. If you remove or alter such checks, beware that even if your program now may run without syntax- or run-time errors, non-backwards-compatible changes in Gekko may change the results (just an example: in Gekko 2.x.x, the statement import <csv> data.csv; gets all data from a .csv file, whereas in Gekko 3.x.x, the same statement import <csv> data.csv; respects/limits the data according to the global time period).

 

For Gekko versions prior to 2.5.3 or in the range 3.0 to 3.1.16, a gekko version statement will fail with a syntax error (but this syntax error should be pretty telling still). Gekko 2.5.3 understands a gekko version statement without date indication, and Gekko 3.1.18+ understands gekko version statements with both version numbers and dates.

 


 

Related functions

 

gekkoVersion(), gekkoVersionDate()

 

 


 

 

Related statements

 

RUN, SIGN