PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Finding out the number of hidden directories
fListDirectory (Example)
Finding out the number of hidden directories
// 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
PROCÉDURE 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
RESULT True
Minimum version required
  • Version 10
This page is also available for…
Comments
Click [Add] to post a comment