Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
_searchenv
◄Summary► ◄Example► ◄Up► ◄Contents► ◄Index► ◄Back►
────────────────────────────────────────────────────────────────────────────
The _searchenv function searches for the target file in the
specified domain. The <varname> variable can be any environment
variable that specifies a list of directory paths, such as PATH,
LIB, INCLUDE, or other user-defined variables. It is most often
PATH, which searches for <filename> on all paths specified in the
PATH variable. The _searchenv function is case sensitive, so
<varname> should match the case of the environment variable.
The routine first searches for the file in the current working
directory. If it does not find the file, it looks next through the
directories specified by the environment variable.
If the target file is found in one of the directories, the newly
created path is copied into the buffer pointed to by <pathname>.
You must ensure that there is sufficient space for the constructed
path name. If <filename> is not found, <pathname> will contain
an empty null-terminated string.
In OS/2, the list of directory paths specified by <varname> can
contain double quotation marks, which indicate that the characters
contained within are not to be interpreted by _searchenv. For
example, _searchenv ignores a semicolon found within quotes,
allowing it to be a character in a file name (for OS/2 version
1.2 file names) and not a path delimiter. The following example
is a setting recognized by _searchenv as containing three
directories:
PATH+C:\BIN;"D:\SEMI;COLON\DIN";C:\BINP
Return Value
None.
-♦-