A concern with Studio

Post Reply
Rob Davies
User
User
Posts: 25
Joined: 3 years ago

A concern with Studio

Post by Rob Davies »

Hi
I have noticed a slightly worrying occurrence using Studio.

I run some code that successfully creates a gdx file that is used in a gdxin statement. Everything works fine.

I then make some changes and rerun the code, which is intended to create a gdx with the same name. If the altered code has an error creating the gdx, there is a warning in the process log. But it seems that if there is already a gdx file with the same name in the project folder, it picks that up and runs giving a normal completion. Unless I watch the process log like a hawk, I miss that it is running using the previous gdx.

I have taken to deleting any gdx files created previously, before each run.

Rob
Fred
Posts: 373
Joined: 7 years ago

Re: A concern with Studio

Post by Fred »

I don't think that Studio can be blamed for that.

Let's assume you have a file a.gdx from a previous run. Now you run some model which contains

Code: Select all

...
* some call to create a.gdx, e.g. through GDXXRW
$call gdxxrw ... o=a.gdx ...
$gdxin a.gdx
...
Now if I understand you correctly, you would expect GAMS not to read a.gdx if the previous GDXXRW call fails. But I see no reason for this. If you want to make sure that the call to an external program like GDXXRW was successful and if it wasn't, abort the current job, you could use the checkerrorlevel flag.

Code: Select all

...
* some call to create a.gdx, e.g. through GDXXRW
$call.checkErrorLevel gdxxrw ... o=a.gdx ...
$gdxin a.gdx
...
I hope this helps!

Fred
Rob Davies
User
User
Posts: 25
Joined: 3 years ago

Re: A concern with Studio

Post by Rob Davies »

Thanks Fred.
I have taken to using checkerrorlevel with the call so I am sure it is not reading in a different gdx.
Much appreciated.
Kind regards
Rob
Post Reply