Current Folder (EV6)

For questions regarding programming in the EViews programming language.

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

fmgoto
Posts: 76
Joined: Thu Jan 15, 2009 5:01 am
Location: Brasilia, Brazil

Current Folder (EV6)

Postby fmgoto » Mon May 17, 2010 10:19 am

Is there a function that outputs the folder where the code is saved?

Something like:

%current_folder = @current_folder
cd %current_folder

Thanks, Fabio

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

Re: Current Folder (EV6)

Postby EViews Gareth » Mon May 17, 2010 11:36 am

Define what you mean by "where the code is saved"

fmgoto
Posts: 76
Joined: Thu Jan 15, 2009 5:01 am
Location: Brasilia, Brazil

Re: Current Folder (EV6)

Postby fmgoto » Mon May 17, 2010 12:57 pm

Suppose I run a code that is saved in "C:/Eviews/code.prg". How do I retrieve %currend_folder = "C:/Eviews/code.prg" without typing it? Thanks!

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

Re: Current Folder (EV6)

Postby EViews Gareth » Mon May 17, 2010 1:17 pm

It is a little more complicated than that in general, but in your case, you'll probably find that @runpath works for you:

Code: Select all

%currpath = @runpath
If you move up to EViews 7, it is a lot more complicated, and you should consult our Whitepaper on paths:
http://eviews.com/download/download.html#docs

fmgoto
Posts: 76
Joined: Thu Jan 15, 2009 5:01 am
Location: Brasilia, Brazil

Re: Current Folder (EV6)

Postby fmgoto » Mon May 17, 2010 1:53 pm

Great! Thank You!

I am afraid I could not find it in the Reference Guide, though.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests