|
Comments may also be included on the front and back of lines with GAMS code. This is done by first defining the columns where the active GAMS instructions appear. Subsequently one enters comments immediately proceeding or succeeding the active code columns. In particular, one can specify the first and last columns on a page of GAMS code that are active GAMS code and thereby both
| • | A leading area of each line can be set off so that the GAMS compiler will ignore it. This is specified by setting the left most column where valid GAMS instructions can occur using the command $Mincol cc. There cc is the first active column where GAMS code appears. In turn, anything to the left of that column is treated as a comment. |
| • | A trailing area of each line can be set off so that the GAMS compiler will ignore it. This is specified by setting the right most column where valid GAMS instructions can occur using the command $Maxcol cc. There cc is the last active column where GAMS code appears. In turn anything to the right of that column is treated as a comment. |
Example:
(Margin.gms)
$ontext
1 2 3 4 5 6
123456789012345678901234567890123456789012345678901234567890
$offtext
$mincol 20 maxcol 45
| Now I have set i plant /US, UK/ | This defines I |
| turned on the scalar x / 3.145 / | A scalar example. |
| margin marking. parameter a, b; | Define some |
parameters.
$offmargin
Only the black section of the statements are active since they appear between columns 19 and 45, and anything before 19 column or after column 45 is treated as a comment.
Notes:
| • | Before comments set off by margins can be used either a $mincol or $maxcol statement must be used. |
| • | Mincol defaults to 1 and is not specified through a $mincol command means there will be no beginning inactive content on GAMS lines. |
| • | Maxcol defaults to the maximum line length currently 32767and if not specified through a $maxcol command means there will not be trailing inactive content on GAMS lines. |
| • | Setting Maxcol to 0 causes GAMS to set it to the maximum allowable number of columns. |
| • | The full content of the lines are copied through to the echo print listing including the area below the mincol and above the maxcol. |
| • | The GAMS statement components falling within the specified columns mincol through maxcol must be fully valid GAMS statements. |
| • | Delineators setting off the margins are entered through the use of $Onmargin and can be removed through $Offmargin. An example appears there. |
|