Page 1 of 1

Change the working directory in a program

Posted: Thu Jun 01, 2017 4:53 am
by 309blank
I am about to submit to a Journal and they require that replication should be as easy as possible. All my statistical analysis happens in a program.

I don't know how I can specify that the working directory for the program is the current program folder.

string path = @runpath
cd path 'define default directory

is not working. I looked at the documentation and I searched the forums, but I can't find an answer that works.

Edit: Forgot to add, I am working with EViews 8.

Re: Change the working directory in a program

Posted: Thu Jun 01, 2017 5:07 am
by 309blank
http://www.eviews.com/download/whitepapers/Paths.pdf

I looked at this, but neither

cd @runpath nor cd @linepath work. I want the program to completely execute just by doubleclicking the .prg file, but it says "Path or file not found : @LINEPATH in "CD @LINEPATH"." And "Path or file not found : @RUNPATH in "CD @RUNPATH"." when I try to run it like that.

Re: Change the working directory in a program

Posted: Thu Jun 01, 2017 5:39 am
by EViews Gareth

Code: Select all

%path = @runpath cd %path

Re: Change the working directory in a program

Posted: Thu Jun 01, 2017 5:49 am
by 309blank
Thanks. How come I have to save it as a replacement variable first?