Hello,
I would like to ask if it is possible to display the file path of the gams file used?
E.g.:
The model is saved on the desktop: “C:\Users.…\Desktop\model.gms”
Is it possible to ask in the gams model to display the file path, like:
display …;
Result should be: “C:\Users.…\Desktop”
Many thanks,
Ruukie
–
To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/QqOxZ7l58bAJ.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.
GAMS has the input file name available in the string variable %gams.i%. You can split ($setnames) an absolute/relative file name in to its parts: path, name, extension and work with these:
$log %gams.i%
$setnames “%gams.i%” filepath filename fileextension
$log %filepath%
$log %filename%
$log %fileextension%
If you needs this in a display statement do:
display ‘%gams.i%’, ‘%filepath%’;
Hope this helps,
Michael Bussieck - GAMSWorld Coordinator
On Monday, November 5, 2012 9:08:05 AM UTC-5, Ruukie wrote:
Hello,
I would like to ask if it is possible to display the file path of the gams file used?
E.g.:
The model is saved on the desktop: “C:\Users.…\Desktop\model.gms”
Is it possible to ask in the gams model to display the file path, like:
display …;
Result should be: “C:\Users.…\Desktop”
Many thanks,
Ruukie
–
To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/aGHE4X4cFVMJ.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.
Hi Michael,
Thank you very much for your help!
Your answer really helps me a lot!
Greetings,
Ruukie
–
To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/DYTAHk2Z_jMJ.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.