09-18-2014 04:53 AM
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.
09-18-2014 12:36 PM
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