DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

sample for how to use DirLstWrite

I am looking for a sample how to use DirLstWrite. I took a DIAdem training course at the end of March in Michigan for 5 days, my teacher's name is David xxx. He supposes to send me an exsample. I have not received it. Does anyone know his email? My email is limingzhou2002@yahoo.com
0 Kudos
Message 1 of 3
(3,655 Views)
Hello,

I don't know who the person was that was teaching the class in Michigan, but here is an example of how to use the DirLstWrite command in DIAdem:

Call DirLstWrite("C:\Datafiles","Test*.dat","filename","test.lst",0)

Here is a description of the different items that this command is made off:

Call - VBS function, calls a DIAdem function

DirLstWrite - Command for storing file names in an ASCII file

"C:\Datafiles" - Directory in which to search for the data files that need to be put into the LST file

"Test*.dat" - Parameter to describe the file name(s) that need to be put into the LST file

"filename" - Parameter that determines how the results will be sorted in the LST file (by file name, by file leng
th, by extension, by date/time of creation)

"test.lst" - name of the LST file

0 - Parameter that determines if the files found with the DirLstWrite function will be added to an exisitng list file or put into a new file (if a file of the same name already exists, it will be overwritten)

The result of the above example will be this:

Test1.dat
Test12.dat
TestA.dat
TestC.dat

I hope this helps. Please let me know if you need additional information.

Otmar
Otmar D. Foehner
0 Kudos
Message 2 of 3
(3,655 Views)
Hello Liming!

I'm David McClelland, the instructor from your DIAdem class. I'm attaching to this posting two different DIAdem VBScripts that you can use to get filenames:

load_multiple_dats.VBS - uses FileNameGet() to allow the user to pick .DAT files through a dialog, then imports those datafiles.

load_multiple_dats_dirlstwrite.VBS - uses DirLstWrite() to automatically find a list of .DAT files, then imports those datafiles.

I'm sorry I didn't get these examples to you sooner!

David Mc.
NI Applications Engineer
0 Kudos
Message 3 of 3
(3,655 Views)