DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

FileDlgFilt for ASCII Import

Hello

 

I want to obtain the name of an ASCII data file using FileNameGet. I cannot find a record anywhere of what to use for the value of FileDlgFilt in order to automatically set the file filter. I have written the code below using an exact copy of the filter as seen in the file open/save dialogue box, but it doesn't work.

 

Call FileNameGet("NAVIGATOR", "FileRead", DataReadPath, "ASCII Import (*.*;*.csv;*.asc;*.txt;*.dat),*.*;*.csv;*.asc;*.txt;*.dat", , , "Data selection")

Can you tell me what value I should be using for FileDlgFilt?

 

Is there a way of finding out what values are required for any of the items in my file filter list? 

 

Thanks.

0 Kudos
Message 1 of 2
(4,781 Views)

Hi Simon,

 

If you want to provide a custom file format filter, then you need to use "ANY" in the first parameter.  When you use "NAVIGATOR" in the first parameter, it overrides any other parameters and always uses the default list of valid files that you see in the NAVIGATOR.  If you really want to filter the files viewed, you also need to remove the "*.*" file extension from the list:

 

FileDlgFilt = "ASCII Import (*.csv;*.asc;*.txt;*.dat),*.csv;*.asc;*.txt;*.dat"
Call FileNameGet("ANY", "FileRead", DataReadPath, FileDlgFilt, , , "Data selection")

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

Message 2 of 2
(4,768 Views)