BuildPath, méthode

Microsoft VBScript

Microsoft® Visual Basic® Scripting Edition BuildPath, méthode  Référence de la bibliothèque d'exécution Scripting
 Version 3

Voir aussi                  Application


Description
Ajoute un nom à un chemin existant.
Syntaxe
object.BuildPath(path, name)

La syntaxe de la méthode BuildPath comprend les éléments suivants :

Élément Description
object Correspond toujours au nom d'un objet FileSystemObject.
path Chemin existant auquel name est ajouté. Le chemin peut être absolu ou relatif et n'est pas obligé de correspondre à un chemin existant.
name Nom ajouté au path existant.

Notes
La méthode BuildPath insère si nécessaire un séparateur de chemin entre le chemin existant et le nouveau nom.

L'exemple ci-dessous illustre l'utilisation de la méthode BuildPath :

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