Equinox Online Help - Language Reference - A to Z
FileSearch |
|
---|---|
Applies to | |
Syntax | FileSearch FilespecExpression [, AttributeExpression, BufferItem] |
Action | [Statement] Searches for a file or set of files within a directory. |
Scope | Usable anywhere |
Notes | This statement searches for an individual file, first of a set of files, a volume label, a directory or first of a set of directories. Wildcard characters '*' & '?' can be used as part of the specification. The path and file specification is specified in FilespecExpression. In order to make the file appear on the server, prepend "SERVER:" (in any case) to the FilespecExpression. This prefix is ignored by the single user version. If the path specification is a relative one, it will start from the program directory - the Eqserver.exe directory for server files, and the Equinox.exe or Equinet.exe directory for everything else. ttributeExpression may contain one or more of the following letters, representing MSDOS file attributes:
A combination of attributes may be used eg "NVD". If AttributeExpression is omitted, the statement looks for normal files by default. If a matching file is not found, SysError is set to a non-zero value. FileSearch is normally used in conjunction with FileSearchNext and FileDetails. FileSearch is used to find the first file matching FilespecExpression and subsequent matches are found using FileSearchNext; the details of each file may be retrieved using FileDetails. The optional BufferItem argument receives a binary buffer which allows nested FileSearch operations using different buffer parameters. The variable supplied as the argument should be declared as a string without specifying a length: 'String SearchBuffer'. The system workarea SysError is set to a non-zero value if an error occurs, otherwise zero. After you have finished with the file information, call FileSearchClose. |
Category | File Management |
See Also | ChooseFile, FileDelete, FileDetails, FileExists, FileHandle, FilePath, FileRename, FileSearch, FileSearchNext, MakeDirectory, RemoveDirectory |
Example | This first example searches for a subdirectory called "MyApp" in the current directory. FileSearch "MyApp", "D" This more extensive method finds and displays the details of all form files in the current directory and all its sub-directories. FindAllFiles "*.frm","" |