Page de démarrage > comp > gb > file > setdir 
 en de es it nl pl pt pt_BR mk sq ca hu cs tr ar fa id vi ko ja ru zh zh_TW eo
Précédent  Suivant  Éditer  Renommer  Annuler  Rafraîchir  Rechercher  Administration  
Documentation
Historique
 
File.SetDir (gb)
Static Function SetDir ( Path As String, NewDir As String ) As String

Définit la partie répertoire d'un chemin, et retourne le chemin ainsi modifié.

Exemple

DIM filePath AS String

PRINT "* Un chemin de type standard "
filePath = "/my/path/file.ext"
PRINT filePath
PRINT File.SetDir(filePath, "/new/path")

PRINT "\\n* Définit un chemin relatif"
filePath = "my/path/file.ext"
PRINT filePath
PRINT File.SetDir(filePath, "new/path")

PRINT "\\n* Ajoute un chemin au nom d'un fichier + extension"
filePath = "file.ext"
PRINT filePath
PRINT File.SetDir(filePath, "/new/path")

PRINT "\\n* Change un chemin sans nom de fichier ni extension"
filePath = "my/path/"
PRINT filePath
PRINT File.SetDir(filePath, "new/path/")


* Un chemin de type standard
/my/path/file.ext
/new/path/file.ext

* Définit un chemin relatif
my/path/file.ext
new/path/file.ext

* Ajoute un chemin au nom d'un fichier + extension"
file.ext
/new/path/file.ext

* Change un chemin sans nom de fichier ni extension
my/path/
new/path/