Sign in Join
FPDoc Onlineexperiment

FindPathInSearchPath function

In unit LazFileUtils

Locates the specified path in a delimited list of search paths.

Declaration

pascal
function FindPathInSearchPath(APath: PChar; APathLen: Integer; 
 SearchPath: PChar; SearchPathLen: Integer)
: PChar; overload

Description

FindPathInSearchPath is an overloaded function used to locate the path specified in APath in a list of search paths.

APath contains the search path to locate in the delimited list of search paths. A trailing path delimiter specified in APath is ignored.

SearchPath contains the delimited list of search paths examined in the function. No actions are performed in the routine when SearchPath has not been assigned (contains Nil) or contains an empty string ( '').

The return value is either an Integer or a PChar value depending on the overloaded variant used in an application. An Integer value represents the position in SearchPath where the value in APath is located. A PChar value contains a pointer to the first character in SearchPath where APath is located. The variant which accepts PChar arguments and returns a PChar value has additional length arguments for the path and search path.

Compiler defines determine the mechanism used to perform a comparison of the values in APath and SearchPath; i.e. CaseInsensitiveFilenames and NotLiteralFilenames. CompareFilenames is called to perform the comparison when inline comparison of string values in not supported.

An experiment, built from Lazarus main 2dfa93c66e of 10-22-2026. Not the official Lazarus documentation.