|
Where am I? |
Top Previous Next |
|
Suppose you are running a comparative analysis job which takes a long time with many solves and you want to know the stage it is on. You can get such information to the screen by including the following pieces GAMS code. To define where output is to be sent for messages to the screen and the log file (comparewhere.gms).
$set console $if %system.filesys% == UNIX $set console /dev/tty $if %system.filesys% == DOS $set console con $if %system.filesys% == MS95 $set console con $if %system.filesys% == MSNT $set console con $if "%console%." == "." abort "filesys not recognized"; file screen / '%console%' /; file log /''/
To send the output to the screen and the log (IDE process window)
loop(scenarios, put screen; put 'I am on scenario ' Scenarios.tl; putclose; put log; put 'I am on scenario ' Scenarios.tl; putclose;
The screen part works fine in DOS or UNIX but not in IDE (there you need to make the DOS window visible by manipulating the options under the execute tab or just send to the LOG file).
The LOG part put entries in the IDE process window. One can also change the name of the DOS box in windows versions starting with Windows 2000 using the put file sequence (dosbox.gms)
File dosbox / titlemaker.cmd/ putclose dosbox '@title this is a new DOS box title'; execute 'titlemaker.cmd'
where again the DOS window must be visible if this is used in the IDE. |