Using filters in @uifiledlg

For questions regarding programming in the EViews programming language.

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

JRMeyer
Posts: 4
Joined: Mon May 09, 2016 10:50 am

Using filters in @uifiledlg

Postby JRMeyer » Mon Jul 18, 2016 7:14 am

I am using @uifiledlg to select an Excel worksheet as an input to my program. All seems to work as advertised with the exception of the Filter argument. I would like for the dialogue box to display only those files with an "xlsx" extension, but all files in the directory are displayed. I would note that using the filter "prg" does successfully list only those files with the .prg extension, so I guess the function is working properly within that narrow field. Am I doing something wrong, or does the filter only apply to .prg files?

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

Re: Using filters in @uifiledlg

Postby EViews Gareth » Mon Jul 18, 2016 8:15 am

The filter only supports "wf", "prg" or "db". The documentation should make this clearer, sorry.

JRMeyer
Posts: 4
Joined: Mon May 09, 2016 10:50 am

Re: Using filters in @uifiledlg

Postby JRMeyer » Mon Jul 18, 2016 8:20 am

OK--thanks. I guess you may consider this as a suggestion for future versions.

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

Re: Using filters in @uifiledlg

Postby EViews Gareth » Mon Jul 18, 2016 9:37 am

There's actually two types of filter going on. The one we currently support is basically "what type of thing am I opening/saving?" where the answer is workfile (i.e. a dataset including Excel, Stata, CSV, etc...), a database or a program.

Withing the workfile setting there is a secondary filter which allows you to specify the exact file type.


I've just added an option to the function which will go out in the next patch that allows you to, crudely, select which file type will be selected by default. It is just an integer value passed in as a string.

For example, to open a file-open dialog preselected to Excel:

Code: Select all

=@uifiledlg("", "wf", "open", "8")

adrian_d
Posts: 44
Joined: Wed Jan 29, 2014 6:08 am

Re: Using filters in @uifiledlg

Postby adrian_d » Tue Aug 02, 2016 4:07 am

There's actually two types of filter going on. The one we currently support is basically "what type of thing am I opening/saving?" where the answer is workfile (i.e. a dataset including Excel, Stata, CSV, etc...), a database or a program.

Withing the workfile setting there is a secondary filter which allows you to specify the exact file type.


I've just added an option to the function which will go out in the next patch that allows you to, crudely, select which file type will be selected by default. It is just an integer value passed in as a string.

For example, to open a file-open dialog preselected to Excel:

Code: Select all

=@uifiledlg("", "wf", "open", "8")
Hi, it is quite a serious change for me that you added this fourth parameter as obligatory. Please update the Programming Reference as soon as possible, because there is no information about what values should be entered.

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

Re: Using filters in @uifiledlg

Postby EViews Gareth » Tue Aug 02, 2016 4:42 am

Yep, that 4th shouldn't have been compulsory. We will fix (to make optional).


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests