Using slash/backslash in path specification with $include

Problems with syntax of GAMS
Post Reply
MarcQC
User
User
Posts: 5
Joined: 5 years ago

Using slash/backslash in path specification with $include

Post by MarcQC »

Hello,
I'm quiete new to Gams studio on Mac :? , while a person I work with is on PC.
A statement like:

$include input_data/Services.txt

will work on Mac, but
$include input_data\Services.txt

is required on PC to run the code.

Is there a way to work around this and make a path specification for input or output data that is platform independent?
Thank you for letting me know.
Marc
Freddy
User
User
Posts: 16
Joined: 5 years ago

Re: Using slash/backslash in path specification with $include

Post by Freddy »

You can (and should) use

Code: Select all

%system.dirsep%
like so:

Code: Select all

$include input_data%system.dirsep%Services.txt 
MarcQC
User
User
Posts: 5
Joined: 5 years ago

Re: Using slash/backslash in path specification with $include

Post by MarcQC »

Thank you!
Post Reply