Help Center

DWStrPathScanfunction

Searches a path for a file name.

String ManagementfunctionDWSTRProcs.incdocumented

Syntax

FUNCTION DWStrPathScan (BYREF wszOption AS CONST WSTRING, BYREF wszFileSpec AS CONST WSTRING, BYREF wszOtherDirs AS CONST WSTRING = "") AS DWSTRING

Parameters

NameDescription
wszOptionOne of the following words which is used to specify the requested part: PATH, NAME, EXTN, NAMEX.
wszFileSpecThe path to be scanned.
wszOtherDirsAn optional path string which includes one or more paths to be searched to find wszFileSpec. If multiple path names are included in this string, they must each be separated by a semicolon (;) delimiter. If wszOtherDirs is not given, or it is a null (zero-length) string, the following directories are searched:
- The directory from which the application was loaded.
- The current directory.
- The standard directories such as System32 and the directories specified in the PATH environment variable.
To expedite the process or enable DWStrPathScan to search a wider range of directories,use the wszOtherDirs parameter to specify one or more directories to be searched first.

Return value

If the file is found, it returns either the full path/file name, or a selected part of it.If the file is not found, a null (zero-length) is returned. If you wish to simply parsea text file name, without regard to its validation on disk, you should use the companionfunction DWStrPathName.

Description

Searches a path for a file name.

Reference

  • Include file DWSTRProcs.inc
  • Defined in AfxNova/DWStrProcs.inc:1383
  • Documented in String Management/DWString Procedures.md
  • Topic: String Procedures