Previous Topic: FindFirstFile - Search for Files in a DirectoryNext Topic: FindNextFile - Continue FindFirstFile Directory Scan


FindNext

Valid on NetWare, Symbian OS, UNIX, Windows and Windows CE

The FindNext function continues a directory scan, which you use it to fetch subsequent files that match the criteria given in FindFirst. FindNext returns one file name for each call of FindNext until no more matching files are found in the directory.

This file content function has the format:

FindNext() as string

Each call of FindNext returns one file name. When no more matching files are found in the directory, it returns an empty string ("").

Example: FindNext function

This example finds and lists all files with the .bat extension in the root directory of the C: drive.

Dim Filename as string

Filename=FindFirst("C:\*.BAT",FA_ANYFILE)
while Filename<>""
	 print Filename
	 Filename=FindNext()
wend