Utilities.TSearchRec Method

Applies to TestComplete 14.93, last modified on October 12, 2021
This method is obsolete. See the Remarks section below.

Description

The Utilities.TSearchRec method creates a TSearchRec object and returns it.

This object is a wrapper for Borland VCL’s TSearchRec structure that is used by the FindFirst method (this method searches for files in a folder). The variable holding this structure is passed to the function as an [out] parameter. That is, the function fills the structure fields with information about the files that were found. Therefore, you should create the structure before calling FindFirst. That is, you should call the TSearchRec method before you call the FindFirst routine (Writing an ordinary VCL application you would simply define a variable of this type, but since scripting languages supports Variant variables only, you should create the structure explicitly).

There is no need to remove the created TSearchRec object. This will be done according to the common rules for working with COM objects: the object will be removed from memory when there are no references to it. This may occur for example, at the end of a function call when all the variables referring to the object are deleted.

Declaration

Utilities.TSearchRec()

Result A TSearchRec object

Applies To

The method is applied to the following object:

Result Value

The created TSearchRec object.

Remarks

The Utilities.TSearchRec method as well as the TSearchRec object are obsolete and supported for backward compatibility only. To search for files, use the aqFileSystem.FindFiles method.

See Also

TSearchRec Object
Using Structures in Scripts
FindFiles Method

Highlight search results