AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Ayuda / ¿Cómo proceder? / Programación
  • Method 1: Retrieving the list of directories directly
  • Method 2: using a procedure to process each directory
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
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 1: Retrieving the list of directories directly
To directly retrieve the list of directories and to process them:
  1. Retrieve in a character string the list of all directories by using fListDirectory.
  2. Browse the retrieved string in a loop. Each directory is separated by a CR character.
  3. Process each directory found.
Code example:
sDirectoryList is string
sDir is string
 
sDirectoryList = fListDirectory("C:\My documents\")
 
FOR EACH STRING sDir OF sDirectoryList SEPARATED BY CR
// Process the sDir directory
// the sDir variable contains the name of directory to process
END
Method 2: using a procedure to process each directory
To process the listed directories via a procedure:
  1. Create a local or internal procedure to process each directory found.
  2. Browse the list of all directories by using fListDirectory with the procedure that was created beforehand.
Code example:
INTERNAL PROCEDURE pProcessDir(sRootDir, sDir)
// Process the directory found
// The sRootDir variable contains the root directory
// The sDir variable contains the folder name
Trace(sRootDir, sDir)
 
END
 
// Browse the directories
fListDirectory("C:\TEMP\", pProcessDir)
Versión mínima requerida
  • Versión 10
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 27/10/2022

Señalar un error o enviar una sugerencia | Ayuda local