Generates a list with filenames.
ReturnValue = DirListGet(DirSearchPath, DirSearchName, DirSortType, [FileLstFilter])
Input Parameters
DirSearchPath |
Specifies on which drive and in which folder DIAdem searches for the files.
|
DirSearchName |
Specifies the name of the file that DIAdem searches for in the specified path.
|
DirSortType |
Specifies wether DIAdem sorts the found list.
| Enumeration variable |
Enumeration variable with the following selection terms
| Script Term |
Interface Term, Explanation |
"filename" |
Filename |
"extension" |
Filename Extension |
"filesize" |
File size |
"Date/Time" |
Date/Time |
|
|
[FileLstFilter] |
Specifies the information that DIAdem saves. By default the FileLstFilter variable contains the value onlyFilenames.
| Enumeration variable |
Enumeration variable with the following selection terms
| Script Term |
Interface Term, Explanation |
"onlyFilenames" |
Only filenames |
"onlyDirectorynames" |
Only path names |
"Filenames" |
Filenames and filename extensions |
"FullFilenames" |
Complete filenames |
"FullFilenamesRecursive" |
Recursive after complete filenames |
"DirectorynamesRecursive" |
Recursive after path names |
|
|
Return Parameters
| ReturnValue |
The return value is a Variant variable type. The return value contains a zero-based array with the entries that the command has found. |
 | Note Sorting with the DirSortType variable is case sensitive. For example, if DIAdem finds the filenames FILE.txt and company.txt, the program enters the filename in uppercase before the filename in lowercase. |
Example
The following example generates a list of all files in the folder C:\ and outputs the list as a message. DIAdem also writes the list into a file.
Dim vFoundFiles, iCount, strAll, hFile
vFoundFiles = DirListGet("C:\", "*.*", "filename", "FullFilenames")
If IsArray(vFoundFiles) Then
For iCount = Lbound(vFoundFiles) to Ubound(vFoundFiles)
strAll = strAll & vFoundFiles(iCount) & VBCrLf
Next
Call MsgBoxDisp(strAll)
hFile=TextFileOpen(ScriptWritePath & "FileList.asc", TfCreate OR TfUnicode OR TfWrite OR TfDenyNone)
Call TextFileWriteln(hFile, strAll)
Call TextFileClose(hFile)
End If