Skip to a specified column: @

Top  Previous  Next

When GAMS encounters a @ in a put statement, the writing position is moved to that column of the output file whether it be forward or backward from the current point.  Thus, one could do one of the following putex4.gms

 

Put 'Hello@3 'Goodbye';

 

which would cause an output line as follows

 

HeGoodbye

 

while

 

Put 'Hello@20 'Goodbye';

 

yields

 

Hello             Goodbye

 

Note the example above using @3 shows how one can go back and overwrite earlier text.
One can use variables or expressions instead of fixed column numbers as in the code below from putex4.gms.

 

 scalar width /15/;

 Put 'Hello' @(width+3) 'Goodbye';

 

@ is commonly used to align columns in the face of unequal set element widths.