GetBaseName Method |
Description
Returns a string containing the base name of the last component, less any file extension, in a path.
PowerBASIC Syntax
Arguments
Return Value
BSTR. The base name.
Remarks
The GetBaseName method returns a zero-length string ("") if no component matches the path argument. The GetBaseName method works only on the provided path string. It does not attempt to resolve the path, nor does it check for the existence of the specified path.
Example [PowerBASIC]
#INCLUDE "windows.inc" #INCLUDE "scrrun.inc"
DIM fso AS IFileSystem DIM strName AS STRING
' Create an instance of the FileSystemObject fso = NEWCOM "Scripting.FileSystemObject" ' Get the base path name from a path strName = fso.GetBaseName (UCODE$("C:\MyFolder\Test.txt"))
|