Change the working directory in a program

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt

309blank
Posts: 9
Joined: Mon Jan 04, 2016 6:48 am

Change the working directory in a program

Postby 309blank » Thu Jun 01, 2017 4:53 am

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.
Last edited by 309blank on Thu Jun 01, 2017 5:07 am, edited 1 time in total.

309blank
Posts: 9
Joined: Mon Jan 04, 2016 6:48 am

Re: Change the working directory in a program

Postby 309blank » Thu Jun 01, 2017 5:07 am

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.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13318
Joined: Tue Sep 16, 2008 5:38 pm

Re: Change the working directory in a program

Postby EViews Gareth » Thu Jun 01, 2017 5:39 am

Code: Select all

%path = @runpath
cd %path
Follow us on Twitter @IHSEViews

309blank
Posts: 9
Joined: Mon Jan 04, 2016 6:48 am

Re: Change the working directory in a program

Postby 309blank » Thu Jun 01, 2017 5:49 am

Thanks. How come I have to save it as a replacement variable first?


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 64 guests