Code: Select all
Directory$ = GetHomeDirectory()
If ExamineDirectory(0, Directory$, "*.*")
count = 0
While NextDirectoryEntry(0)
count + 1
Wend
Debug("Total items found: " + Str(count))
EndIf
Maybe it could be called DirectoryEntriesSize() (or something along those lines).
Such a command would allow to execute a boolean test on the examined Directory before actually iterating through a While NextDirectoryEntry() loop! — For example:
Code: Select all
Directory$ = GetHomeDirectory()
If ExamineDirectory(0, Directory$, "*.txt")
If DirectoryEntriesSize(0)
; At least one *.txt file was found ...
While NextDirectoryEntry(0)
; Do something with the txt files ...
Wend
Else
Debug("No txt files found!")
EndIf
EndIf
Code: Select all
If DirectoryEntriesSize(0) > 10
Code: Select all
If DirectoryEntriesSize(0) > DirectoryEntriesSize(1)