put10.gms : $on/offput inserted outside the loop

Description

Trac #1750

Contributor: Alex Meeraus


Small Model of Type : GAMS


Category : GAMS Test library


Main file : put10.gms

$title $on/offput inserted outside the loop (PUT10,SEQ=447)

$onText
Trac #1750

Contributor: Alex Meeraus
$offText

set i master set of sites / i1 Seattle
                            i2 Portland
                            i3  /;

execute 'rm -f temp1.put temp2.put'

$onText
 This will write a file containing

 Seattle
 Portland
 i3
 test
$offText
file temp1; put temp1;
loop(i, put i.te(i) /; );
$onPutS
test
$offPut
putclose;

$onText
 If you take off the semicolon at the end of the loop it writes

this is now correct - the ; triggered to read the next line which was
a $ control ......

 Seattle
 test
 Portland
 test
 i3
 test
$offText

file temp2; put temp2;
loop(i, put i.te(i) /; )
$onPutS
test
$offPut
putclose;

execute 'diff temp1.put temp2.put'
abort$errorlevel 'files are not equal';