FindFile Function

Syntax

Boolean FindFile(String fileToFind, Boolean useCurSeqFileDir = True, [String PathToFile], Number promptFlag = 1, Number searchFlag = 1, [Out] [Boolean canceled], Boolean isCommand = False)

Return Value

Boolean

True if the file is found, False otherwise.

Purpose

This function attempts to locate the file you specify in the TestStand search directories.

Parameters

fileToFind as String

A string containing the name of the file to search for.

useCurSeqFileDir as Boolean

(Optional) Pass True to search the current sequence file directory (if any). Default value is True.

PathToFile as String

(Optional output) The full path to the file, if the file is found. If the file is not found, this parameter contains an empty string

promptFlag as Number

(Optional) Specifies whether to prompt the user for the location of the file if it cannot be found in the search directories. The valid values are:     1 - (default) Use the engine's configuration option to determine whether to prompt the user.     2 - Prompt the user.     3 - Do not prompt the user.

searchFlag as Number

(Optional) Specifies the behavior of the "Add Directory to Search Directory List" check box, if you choose to prompt the user. The valid values are:     1 - (default) Undim the checkbox, thereby allowing the user to decide whether to append the directory that contains the file to the list of search directories, if the current user has configure engine privileges.     2 - Dim the checkbox in the enabled state if the current user has configure engine privileges.     3 - Dim the checkbox in the disabled state.     4 - Same as 1 but does not check user privileges.     5 - Same as 2 but does not check user privileges.

canceled as Boolean

(Optional output) whether the user cancelled the search for the file.

isCommand as Boolean

(Optional) Specifies whether the file is a command. If you pass true and fileToFind has no file extension then FindFile searches for files with the same basename that end in the common command extensions: .exe, .com, and .bat. If the file is not found in the search directories, FindFile searches the registry for registered applications. The default is False.