Page 1 of 1

uilist, string and wfopen

Posted: Fri May 01, 2015 3:18 am
by eviewsuserforum
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

Re: uilist, string and wfopen

Posted: Fri May 01, 2015 8:01 am
by EViews Gareth
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.

Re: uilist, string and wfopen

Posted: Fri May 01, 2015 9:10 am
by eviewsuserforum
Thank you for the clarification. I could make it work.