|
|
|
|
|
- Method: Retrieving the list of directories directly
- Method 2: Using a procedure to process each directory separately
How to browse the directories of a disk?
To browse the directories of a disk, you must use fListDirectory. This function is used to: - list all the directories and sub-directories of a disk.
- list the directories of a disk without going into the sub-directories.
- list the directories with a filter.
Two browse methods are available: Method: Retrieving the list of directories directly To directly retrieve the list of directories and to process them: - Retrieve in a character string the list of all directories by using fListDirectory.
- Browse the retrieved string in a loop. Each directory is separated by a CR character.
- Process each directory found.
Code sample: sDirectoryList is string
sDir is string
sDirectoryList = fListDirectory("C:\My documents\")
FOR EACH STRING sDir OF sDirectoryList SEPARATED BY CR
END
Method 2: Using a procedure to process each directory separately To process the listed directories via a procedure: - Create a local or internal procedure to process each directory found.
- Browse the list of all directories by using fListDirectory with the procedure that was created beforehand.
Code sample: INTERNAL PROCEDURE pProcessDir(sRootDir, sDir)
Trace(sRootDir, sDir)
END
fListDirectory("C:\TEMP\", pProcessDir)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|