• Welcome to Jose's Read Only Forum 2023.
 

IFileSystem.GetExtensionName Method

Started by José Roca, July 14, 2008, 02:41:52 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

José Roca



The following example illustrates the use of the GetExtensionName method.

JScript


function GetAnExtension(filespec)
{
   var fso, s = "";
   fso = new ActiveXObject("Scripting.FileSystemObject");
   s += fso.GetExtensionName(filespec);
   return(s);
}


VBScript


Function GetAnExtension(DriveSpec)
   Dim fso
   Set fso = CreateObject("Scripting.FileSystemObject")
   GetAnExtension = fso.GetExtensionName(Drivespec)
End Function


PowerBASIC


FUNCTION GetAnExtension (BYVAL strDriveSpec AS STRING) AS STRING

   LOCAL fso AS IFileSystem

   fso = NEWCOM ("Scripting.FileSystemObject")
   FUNCTION = ACODE$(fso.GetExtensionName(strDrivespec))

END FUNCTION