DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Using FileNameGet to store a list file in the data directory

Hi,

 

I'm using FileNameGet to select multiple files, whose names are then stored in a list file for later use. My code is:

 

Call FileNameGet("ANY", "FileRead", DataDrvUser, "DIAdem TDM Files (*.TDM),*.tdm", FileDlgDir&"FileList.lst", "False", "Select ALL data files for processing")

 The files are all located in one folder but that isn't necessarily the location stored in DataDrvUser. I want FileList.Lst to be stored in the folder where the data files are found but I cannot find a suitable value for FileDlgASCIIName. According to the help files FileList.Lst will be stored in the SCRIPT user folder if no path is provided or, alternatively, if a path is provided then it will be stored there. However, apart from a messy copy and paste manoeuvre after the list file has been written, I can't find a simple way of providing FileDlgASCIIName with the path that is about to be written to FileDlgDir!

 

Cheers,

 

Si.

 

 

0 Kudos
Message 1 of 4
(3,899 Views)

Hello Simon,

 

I’m not very familiar with DIAdem, however I will endeavour to help you! I have found a link to some example code which you may find useful:

 

http://zone.ni.com/reference/en-XX/help/370859H-01/comoff/filenameget/

 

Let me know how you get on.

Regards

Andrew George @ NI UK
0 Kudos
Message 2 of 4
(3,877 Views)

Thanks but I've read the help files.

0 Kudos
Message 3 of 4
(3,874 Views)

Hi Simon,

 

The only way really to get the .lst file with the list of files is by moving it after it gets created. This is because the function does not return where the files have come from until after the function has executed, the parameter that is used for placement of the .lst file needs to be resolved before the function executes.

 

Unless there was some way to know where the files are, there is no way to put the file list into the same directory.

 

You could however, perhaps take the list of files returned and find a way to parse for the directory then resave all the files as a .lst into the folder since now you know what directory the files are from.

               

 

Regards

Andrew George @ NI UK
0 Kudos
Message 4 of 4
(3,787 Views)