Correcting a syntax error

Top  Previous  Next

The edit window will show two tabs on the notebook; one for the '.gms' file, the second for the '.lst' file. Select the trnsport.gms tab, so we can modify the model.

 

After selecting the gms file, we want to introduce a syntax error. Position the cursor on line 37 for the table statement and type a comma after the j. You can use the mouse or the up- and down arrow keys to move to line 37. You can also specify a line number directly by pressing Ctrl+G and enter the line number.

 

Click the run button again to run the model. The gms file will be saved automatically. Notice that the lst file disappeared from the editor. The process window will show the GAMS errors in red; double-click on the red line with "*** Error 2". In stead of showing the lst file, the cursor will move to the gms file and the position of the cursor will be close to the syntax error.

 

A double-click in the process window will position the cursor in the lst file when the line is black, and position the cursor in the gms file when the line is red. To position the cursor in the lst file when the line is red, hold down the Shift key when double-clicking.