Jose's Read Only Forum 2023

Legacy Software (PBWIN 9.0+/PBCC 5.0+) => Windows Script Runtime => Source Code => Scripting => FileSystemObject => Topic started by: José Roca on July 14, 2008, 05:21:15 AM

Title: IDrive.FileSystem Property
Post by: José Roca on July 14, 2008, 05:21:15 AM


The following code illustrates the use of the FileSystem property:

JScript


function ShowFileSystemType(drvPath)
{
   var fso,d, s;
   fso = new ActiveXObject("Scripting.FileSystemObject");
   d = fso.GetDrive(drvPath);
   s = d.FileSystem;
   return(s);
}


VBScript


Function ShowFileSystemType(drvspec)
   Dim fso,d
   Set fso = CreateObject("Scripting.FileSystemObject")
   Set d = fso.GetDrive(drvspec)
   ShowFileSystemType = d.FileSystem
End Function


PowerBASIC


FUNCTION ShowFileSystemType (BYVAL drvspec AS STRING) AS STRING

   LOCAL fso AS IFileSystem
   LOCAL d AS IDrive
   
   fso = NEWCOM "Scripting.FileSystemObject"
   d = fso.GetDrive(UCODE$(drvspec))
   FUNCTION = ACODE$(d.FileSystem)

END FUNCTION