Page 1 of 1

string variable used in path reference

Posted: Fri Apr 22, 2011 4:25 pm
by eviewsnew
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

Re: string variable used in path reference

Posted: Fri Apr 22, 2011 10:02 pm
by EViews Gareth
Try:

Code: Select all

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

Re: string variable used in path reference

Posted: Mon Apr 25, 2011 10:48 am
by eviewsnew
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

Re: string variable used in path reference

Posted: Mon Apr 25, 2011 12:18 pm
by EViews Gareth
Only the Command and Programming Reference, and what you can pick up by reading this forum.