Equinox Online Help - Language Reference - A to Z

Home

FileSearchNext

Applies to
SyntaxFileSearchNext [BufferItem]
Action[Statement] Searches for the next of a set of files within a directory after a successful FileSearch statement.
ScopeUsable anywhere
Notes

This statement can only be used to search for the next file or directory after a successful FileSearch operation.

The optional BufferItem argument receives a binary buffer which allows nested FileSearch operations using different buffer parameters. See the FileSearch statement for more details.

The system workarea SysError is set to a non-zero value if an error occurs, otherwise zero.

CategoryFile Management
See Also ChooseFile, FileDelete, FileDetails, FileExists, FileHandle, FilePath, FileRename, FileSearch, FileSearchNext, MakeDirectory, RemoveDirectory
Example

An extensive example of the use of FileSearch and FileSearchNext is shown under the FileSearch help entry.

This example searches for all files in a directory matching the search pattern "*.dat", retrieves and prints their details to the print window.

string a,n,p,y
date d
time t
long s

a="*.dat"

| Look for the filespec
FileSearch a

if syserror then exit method

| Print the path
FilePath a,p
Print p

repeat
| Fetch the file details
FileDetails n,y,d,t,s

| Print the details in the print window
Print Chr(9),n,y,d,t,s

| Look for the next file matching the filespec
FileSearchNext
Until SysError