uilist, string and wfopen

For questions regarding programming in the EViews programming language.

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

eviewsuserforum
Posts: 19
Joined: Wed Apr 22, 2015 5:11 am

uilist, string and wfopen

Postby eviewsuserforum » Fri May 01, 2015 3:18 am

Hi. I wish to open a workfile based on user's selection in a @uilist.
I am having rough time with that.
Can anyone help?

Code: Select all

string country = "uk" @uilist(country, "select a country:", "uk us") if %country = "uk" then %region="europe" endif if %country = "us" then %region="namerica" endif ' I wish to open the following workfiles, alternatively ' g:\eviews\europe\uk\uk.wf1 ' g:\eviews\namerica\us\us.wf1 wfopen g:\models_eviews\{%region}\{%country}\{%country}
Thank you

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

Re: uilist, string and wfopen

Postby EViews Gareth » Fri May 01, 2015 8:01 am

Your if statements refer to the program variable %country.

Nowhere have you defined the program variable %country - it doesn't exist.

You have defined a workfile string variable called country, but this is not the same thing as %country.

eviewsuserforum
Posts: 19
Joined: Wed Apr 22, 2015 5:11 am

Re: uilist, string and wfopen

Postby eviewsuserforum » Fri May 01, 2015 9:10 am

Thank you for the clarification. I could make it work.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 1 guest