string variable used in path reference

For questions regarding programming in the EViews programming language.

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

eviewsnew
Posts: 22
Joined: Fri Apr 22, 2011 2:58 pm

string variable used in path reference

Postby eviewsnew » Fri Apr 22, 2011 4:25 pm

I'm trying to use a string variable to indicate the directory path for opening a file. But it doesn't work. But if i specify the whole path clearly and without the string variable, it works.

Can you help?

Is there any good reference book for Eviews programming for beginner?

thanks!

works:wfopen \\sac-psas-01\econ\riskindex\RI_V3.1\data\2011Q1\ur_nsa_eviews.csv

doesn't work:

%dir="2011Q1"
wfopen \\sac-psas-01\econ\riskindex\RI_V3.1\data\%dir\ur_nsa_eviews.csv

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

Re: string variable used in path reference

Postby EViews Gareth » Fri Apr 22, 2011 10:02 pm

Try:

Code: Select all

%dir="2011Q1" wfopen \\sac-psas-01\econ\riskindex\RI_V3.1\data\{%dir}\ur_nsa_eviews.csv

eviewsnew
Posts: 22
Joined: Fri Apr 22, 2011 2:58 pm

Re: string variable used in path reference

Postby eviewsnew » Mon Apr 25, 2011 10:48 am

Yes it works this way. thanks!

is there a good book to recommend about these programming rules?
Try:

Code: Select all

%dir="2011Q1" wfopen \\sac-psas-01\econ\riskindex\RI_V3.1\data\{%dir}\ur_nsa_eviews.csv

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

Re: string variable used in path reference

Postby EViews Gareth » Mon Apr 25, 2011 12:18 pm

Only the Command and Programming Reference, and what you can pick up by reading this forum.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 1 guest