TRANSLATE

<< Click to Display Table of Contents >>

Navigation:  Gekko User Manual > Gekko statements >

TRANSLATE

Previous pageReturn to chapter overviewNext page

The statement translates command files (.cmd) from AREMOS or older versions of Gekko.

 

Translate from AREMOS to Gekko 3.0. Details here.

Translate from Gekko 2.0/2.2/2.4 to Gekko 3.0. Details here.

Other translation: <move>, <remove> for Gekko 3.0 files.

 

Note: to translate from Gekko 1.8 to Gekko 2.0, this is possible using for instance the Gekko 2.4 or 3.0 stable release versions. The 1.8 to 2.0 translator is not available in Gekko 3.1.x.

 

Note that the translators are for command files (.cmd/.gcm), not model files (.frm).

 

The user is advised to compare the non-translated and translated files line by line, perhaps with a file comparison utility. The translators are by no means perfect, and should be thought of as translation guides.

 


 

Syntax

 

translate < AREMOS GEKKO20 MOVE REMOVE KEEPTYPES > filename ;

 

AREMOS

(Optional). Translates command files (.cmd) from AREMOS syntax. If you prefer to omit parentheses around lists of numbers in SERIES statements, you can use TRANSLATE<remove> to remove these afterwards.

GEKKO20

(Optional). Translates program files (.gcm) from Gekko 2.0/2.2/2.4 syntax to Gekko 3.0 syntax. NOTE: the translator is not intended for .frm files (model files). Use TRANSLATE <gekko20 keeptypes> ... ; to keep type keywords in assignment statements.

KEEPTYPES

(Optional). An option for the Gekko 2.0 translator only. You may optionally keep types when translating assignments, so that VAL x = 100; becomes VAL %= 100; instead of just %= 100;. Applies to SERIES, VAL, DATE, STRING, LIST and MATRIX.

MOVE

(Optional). A simple translator that moves the <>-field in assignments (typically SERIES statements). For instance: <2010 2020> y = 100; becomes <2010 2020> = 100;. This translator does not touch anything else, so it is for existing 3.0 files where the user would like to move the option fields. It will also convert series <2010 2020> y = 100; into series y <2010 2020> = 100;, but not remove the SERIES keyword.

REMOVE

(Optional). A simple translator that removes superfluous ()-parenteses around a comma-separated list of numbers in assignments (typically SERIES statements). For instance: = (2, 3, 4); becomes = 2, 3, 4;. This translator does not touch anything else, so it is for existing 3.0 files where the user would like to remove such parentheses.

filename

Filenames may contain an absolute path like c:\projects\gekko\bank.gbk, or a relative path \gekko\bank.gbk. Filenames containing blanks and special characters should be put inside quotes. Regarding reading of files, files in libraries can be referred to with colon (for instance lib1:bank.gbk), and "zip paths" are allowed too (for instance c:\projects\data.zip\bank.gbk). See more on filenames here.

 

The translator to Gekko 3.0 will create a new file with "_translate" added to the file name.

 

 


 

Examples

 

To translate calc2.cmd (written in AREMOS) to calc2.gcm (Gekko 3.0 syntax), use

 

translate <aremos> calc2;

 

Translate p.gcm (written in Gekko 2.0/2.2/2.4) to p_translate.gcm (Gekko 3.0):

 

translate <gekko20> p;

 

The translators will do their best to come up with syntax suggestions to suit Gekko 3.0, but be warned that the resulting file may not even parse or run, or if it runs, it may even yield the wrong results! So please use with some care. That being said, the translators typically alleviate quite a lot of tedious editing of relatively easy code, so that the user can concentrate on translating the more tricky parts.

 

Please inspect the code thoroughly afterwards, preferably with a file comparing tool. (For instance in Total Commander: mark the two files, and use 'Files' --> 'Compare by content' to highlight the differences).

 

 


 

Related statements

 

RUN