File.SetDir (gb)

Static Function SetDir ( Path As String, NewDir As String ) As String

Imposta la parte della directory di un percorso e restituisce il percorso modificato.

Esempi

DIM filePath AS String

PRINT "* Un tipo standard di percorso"
filePath = "/my/path/file.ext"
PRINT filePath
PRINT File.SetDir(filePath, "/new/path")

PRINT "\n* Imposta un percorso relativo"
filePath = "my/path/file.ext"
PRINT filePath
PRINT File.SetDir(filePath, "new/path")

PRINT "\n* Aggiungi un percorso a un file con estensione"
filePath = "file.ext"
PRINT filePath
PRINT File.SetDir(filePath, "/new/path")

PRINT "\n* Change a path without a file name and extension"
filePath = "my/path/"
PRINT filePath
PRINT File.SetDir(filePath, "new/path/")

* Un tipo standard di percorso
/my/path/file.ext
/new/path/file.ext

* Imposta un percorso relativo
my/path/file.ext
new/path/file.ext

*  Aggiungi un percorso a un file con estensione
file.ext
/new/path/file.ext

* Cambia un percorso privo del nome del file e di estensione
my/path/
new/path/