DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

how do I get a list of files in the DataDrvUser Dir programatically (no dialogs)

I have version 8.1.1292 of Diadem. I wish to get a list of files in a directory without using a dialog.
0 Kudos
Message 1 of 3
(3,601 Views)
Hello Sweeten

Attached are two snipits of code, hope this helps

The following sub reads all the folders in a root folder. Note the use the FSO or file system object. The FSO has a number of properties and methods for working with files and folders, would definetly check it out.

Sub ReadProjects()
'This sub reads all the Folders in the root
Set fso = CreateObject("Scripting.FileSystemObject")
Set Folder = fso.Getfolder(RootPath_)
Set Folder = Folder.SubFolders
i=1
For Each SubFolder In Folder
LstStates.Items.add SubFolder.name,i
i=i+1
Next
End Sub

This next code snipit reads all the files of a certain extention (i.e. LPD,DAT)

Sub ReadProjectFiles()
Dim fso,PathName,LvdNames,GraNames,path
Dim x,y,z
x=1:y=1:z
=1:w=1
Set fso = CreateObject("Scripting.FileSystemObject")
Set Folder = fso.Getfolder(ProjectPath_)
Set Files = Folder.Files

For Each file In files
Select Case file.type
Case "LPD File"
LstGraph.items.add file.name , x
x=x+1
Case "DAT File"
LstData.Items.add file.name , y
y = y+1
Case "LVD File"
LstView.Items.add file.name , z
z = z+1
End Select
Next

Let me know if this is helpful

Tom Ferraro
DIAdem Product Manager
512-683-6841
Message 2 of 3
(3,601 Views)
Hello Sweeten,

the easiest way to get a ASCII-List of files is "DirLstWrite(..)". It is a very old, but powerfull command.

Syntax :

DirLstWrite(DirSearchPath, DirSearchName, DirSortType, FileLstName, FileLstMode, [FileLstFilter])

Take a look to DIAdem-Help for detailed informations and examples.

I like this command to generate listfiles, using them as parameter in user-variables type "G" (Grössenliste)

CU

Martin
0 Kudos
Message 3 of 3
(3,601 Views)