Author Topic: IFileSystem.BuildPath Method  (Read 2139 times)

0 Members and 1 Guest are viewing this topic.

Offline José Roca

  • Administrator
  • Hero Member
  • *****
  • Posts: 2524
  • User-Rate: +209/-0
  • Gender: Male
IFileSystem.BuildPath Method
« on: July 14, 2008, 03:26:43 AM »

The following example illustrates use of the BuildPath method.

JScript

Code: [Select]
function GetBuildPath(path)
{
   var fso, newpath;
   fso = new ActiveXObject("Scripting.FileSystemObject");
   newpath = fso.BuildPath(path, "Sub Folder");
   return(newpath);
}

VBScript

Code: [Select]
Function GetBuildPath(path)
   Dim fso, newpath
   Set fso = CreateObject("Scripting.FileSystemObject")
   newpath = fso.BuildPath(path, "Sub Folder")
   GetBuildPath = newpath
End Function

PowerBASIC

Code: [Select]
FUNCTION GetBuildPath (BYVAL strPath AS STRING) AS STRING

   LOCAL fso AS IFileSystem
   LOCAL bstrNewPath AS STRING

   fso = NEWCOM "Scripting.FileSystemObject"
   bstrNewPath = fso.BuildPath(UCODE$(strPath), UCODE$("Sub Folder"))
   FUNCTION = ACODE$(bstrNewPath)

END FUNCTION