Product SiteDocumentation Site

8.61. SysSearchPath


>>-SysSearchPath(path,filename-+-----------+-)-----------------><
                               +-,--option-+

Searches the specified file path for the specified file. If the file is found, the search returns the full file specification of the first file found within the path, and then stops searching. If the file is not found, the search returns a null string.
Parameters:
path
An environment variable name. The environment variable must contain a list of file directories. Examples are "PATH" or "DPATH".
filename
The file for which the path is to be searched.
option
Specifies where the search starts.
"C"
Starts the search at the current directory and then along the specified path. This is the default.
"N"
Starts the search at the path, not at the current directory.

Example 8.34. RexxUtil - SysSearchpath

/* Code */
fspec = SysSearchPath("PATH", "CMD.EXE")
say "CMD.EXE is located at" fspec

/* Output */
CMD.EXE is located at C:\WIN\CMD.EXE