AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Ayuda / WLanguage / Funciones WLanguage / Funciones estándar / Funciones de archivos externos
  • Finding out the number of hidden directories
fListDirectory (Example)
Finding out the number of hidden directories
The following code is used to return the number of hidden directories found in a directory selected by the user. The directory is selected by fSelectDir.
// Declare and initialize the variables
 
// Number of directories matching the criteria
NbDirectoryLS is int  
NbDirectory is int = 0
SearchCriterion is string
// Select the directory in which the directories will be listed
SearchCriterion = fSelectDir("", "Select a directory", ...
"Searching for hidden directories")
// List of directories
NbDirectoryLS = fListDirectory("C:\MyDocuments", "DirectoryAttribute", ...
&NbDirectoryLS)
// Display the number of files matching the criteria
Info("There are " + NbDirectoryLS + " hidden directories on " + ...
NbDirectory + " listed directories")
// --------------------------------------------------------
// Local procedure called by fListDirectory
PROCEDURE DirectoryAttribute(Directory, Name, Change, NbDirectory)
// Declare the variable
NbDirectoryLS is int
// Hidden directory?
IF Position(fAttribute(Directory + Name), "H") <> 0 THEN
Transfer(&NbDirectoryLS, NbDirectory, 4)
  NbDirectoryLS ++
  Transfer(NbDirectory, &NbDirectoryLS, 4)
  // Display the name of the directory in the "LIST_FileList" list
  ListAdd(LIST_FileList, Directory + Name)
END
RETURN True
Versión mínima requerida
  • Versión 10
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 22/07/2022

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