GetExtensionName Method |
Description
Returns a string containing the extension name for the last component in a path.
PowerBASIC Syntax
Arguments
Return Value
BSTR. The extension name.
Remarks
For network drives, the root directory (\) is considered to be a component.
The GetExtensionName method returns a zero-length string ("") if no component matches the path argument.
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 extension name strName = fso.GetExtensionName(UCODE$("C:\MyFolder\Test.txt"))
|