Enable $show / $showVariables from Command Line

Problems with syntax of GAMS
Post Reply
chrispahm
User
User
Posts: 20
Joined: 6 years ago

Enable $show / $showVariables from Command Line

Post by chrispahm »

Hi :wave:

I'm parsing the results of the $show command, specifically $showVariables (aka the compile time variable list) using a script. Right now, the script relies on the $show command being present at the end of an input GAMS file, otherwise the compile time variable list would obviously not be printed to the listing file.

Sometimes, the $show command is deleted on accident, which then breaks the script. Is there a way to enable the $show from the command line, or a possibility to export the list of compile time variables to a file (e.g. like the reference command https://www.gams.com/45/docs/UG_GamsCal ... Oreference).

Thanks for your help!
Best
Christoph
Lutz
User
User
Posts: 60
Joined: 7 years ago

Re: Enable $show / $showVariables from Command Line

Post by Lutz »

Christoph,

There is no command line parameter or similar to trigger this. The first thing that comes to my mind for this is to run with some `driver.gms` which you run to wrap `yourMoldel.gms` like this

Code: Select all

$include %myCode%
$show
and call it like

Code: Select all

gams driver.gms --myCode=yourModel.gms
. In such driver you could then of course also define more things you usually need.

Hope that helps,
Lutz
chrispahm
User
User
Posts: 20
Joined: 6 years ago

Re: Enable $show / $showVariables from Command Line

Post by chrispahm »

Hey Lutz,

Thanks your suggestion! That's indeed a clever and simple solution, though I have to check if it breaks other parts of the script since it changes the include file structure!
Thanks,
Christoph
Post Reply