---
url: /statelake/scripting-reference/classes/tflofilesearch-class.md
---

# TFloFileSearch Class

The **NewFileSearch** function returns a **TFloFileSearch** object.

The **TFloFileSearch** object class supports the properties as listed in the table below, in the format -

TFloFileSearch.\<property>

| Property Name | Description |
|---|---|
| Count | The number of matching files.Accessing this property causes the search criteria to be re-applied and a new file search to be performed to identify the matching files AND to be performed again to reset the search to enable files to be processed individually if required. |
| EOF | Indicates that no more files are found.Use in conjunction with the **Next** method (as described below) to process matching files one at a time, using the **FileAttr**, **FileName** and **FileSize** properties. |
| Exists | Indicates whether any files match the criteria. |
| FileAttr | ATTR mask for the current file. |
| FileName | Filename of the current file. |
| FileSize | The size (in bytes) of the current file. |

**TFloFileSearch** also supports the following methods as below, using the format -

TFloFileSearch.\<method>

| Method Name | Description |
|---|---|
| GetFileNames(TStringList) | Retrieves a list of all matching filenames that meet the search criteria into the **TStringList** supplied.This list must be created before calling the method. |
| Next | Call this method to advance the search to the **Next** matching file.Use in conjunction with the **EOF**, **FileAttr**, **FileName** and **FileSize** properties. |
| Free | Empties/clears the **TFloFileSearch** object.Calling this method causes the search criteria to be re-applied and a new file search to be performed to identify the matching files AND to be performed again to reset the search to enable files to be processed individually if required. |

The **TFloFileSearch** object result that is returned must be disposed of when finished with, using the **Free** method, as per the following example.

```pascal
vsearch := NewFileSearch(PATH, SPEC, ATTR);
try
//The code to be processed
finally
  vsearch.Free;
end;
```

For additional information, please refer to the [NewFileSearch](/statelake/scripting-reference/functions-and-procedures/file-functions/newfilesearch) function.
