File.SetDir (gb)

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

Altera a parte do caminho de um diretório, e retorna o caminho modificado.

Exemplos

DIM filePath AS String

PRINT "* Um tipo de caminho padrão"
filePath = "/my/path/file.ext"
PRINT filePath
PRINT File.SetDir(filePath, "/new/path")

PRINT "\\n* Defina um caminho relativo"
filePath = "my/path/file.ext"
PRINT filePath
PRINT File.SetDir(filePath, "new/path")

PRINT "\\n* Adicione um caminho para um arquivo e extensão"
filePath = "file.ext"
PRINT filePath
PRINT File.SetDir(filePath, "/new/path")

PRINT "\\n* Alterar um caminho sem um nome de arquivo e extensão"
filePath = "my/path/"
PRINT filePath
PRINT File.SetDir(filePath, "new/path/")

* Um tipo de caminho padrão /my/path/file.ext /new/path/file.ext * Defina um caminho relativo my/path/file.ext new/path/file.ext * Adicione um caminho para um arquivo e extensão file.ext /new/path/file.ext * Alterar um caminho sem um nome de arquivo e extensão my/path/ new/path/