The following example illustrates the use of the
GetBaseName method.
JScript
function GetTheBaseName(filespec)
{
var fso, s = "";
fso = new ActiveXObject("Scripting.FileSystemObject");
s += fso.GetBaseName(filespec);
return(s);
}
VBScript
Function GetTheBaseName(filespec)
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
GetTheBaseName = fso.GetBaseName(filespec)
End Function
PowerBASIC
FUNCTION GetTheBaseName (BYVAL strFileSpec AS STRING) AS STRING
LOCAL fso AS IFileSystem
fso = NEWCOM ("Scripting.FileSystemObject")
FUNCTION = ACODE$(fso.GetBaseName(UCODE$(strFileSpec)))
END FUNCTION