ListFiles Procedure

Lists all the files in a given directory. Use ListDirectories to list all of the subdirectories.
Declaration
function ListFiles(path as String) as List of String

Parameters

Return value

List of String — List of files (path and filename).

Possible error codes

Example

Code
CreateDirectory PathCombine(["testdir", "subdir1"])
CreateDirectory PathCombine(["testdir", "subdir2"])
WriteFileText PathCombine(["testdir", "file1"]), "111"
WriteFileText PathCombine(["testdir", "file2"]), "222"
WriteFileText PathCombine(["testdir", "file3"]), "333"
print "Num dirs: "; Len(ListDirectories("testdir"))
print "Num files: "; Len(ListFiles("testdir"))
DeleteDirectory "testdir", true
Output
Num dirs: 2
Num files: 3