Skip to content

StringPathName

Xusinboy Bekchanov edited this page Nov 6, 2023 · 4 revisions

StringPathName Function

============================================================================

Parses a path/file name to extract component parts. This function evaluates a text path/file text name, and returns a requested part of the name. The functionality is strictly one of string parsing alone. wszOption is one of the following words which is used to specify the requested part: PATH Returns the path portion of the path/file Name. That is the text up to and including the last backslash (\) or colon (:). NAME Returns the name portion of the path/file Name. That is the text to the right of the last backslash (\) or colon (:), ending just before the last period (.). EXTN Returns the extension portion of the path/file name. That is the last period (.) in the string plus the text to the right of it. NAMEX Returns the name and the EXTN parts combined. Example: StringPathName("C:\VisualFBEditor\Poject.Bas") ->C:\Visual Free Basic\ StringPathName("C:\VisualFBEditor\Poject.Bas","NAME") ->Poject StringPathName("C:\VisualFBEditor\Poject.Bas","NAMEEX") ->Poject.Bas StringPathName("C:\VisualFBEditor\Poject.Bas","EXTN") -> .Bas

============================================================================

Syntax

Function StringPathName(ByRef wszFileSpec As WString, ByRef wszOption As Const WString = "PATH") As UString

Parameters

Part Type Description
wszFileSpec WString Required.
wszOption Const WString Optional.

Return Value

UString
Clone this wiki locally