Home > comp > gb > file > setname 
 en fr de es nl pl pt pt_BR mk sq ca hu cs tr ar fa id vi ko ja ru zh zh_TW eo
Precedente  Successivo  Modifica  Rinomina  Undo  Search  Amministrazione  
Documentazione  
Attenzione! Questa pagina non รจ tradotta.  Vedi versione in inglese 
File.SetName (gb)
STATIC FUNCTION SetName ( Path AS String, NewName AS String ) AS String

Sets the file name part of a path, and returns the modified path.

Esempio

DIM filePath AS String

PRINT "* A standard type of path"
filePath = "/my/path/file.ext"
PRINT filePath
PRINT File.SetName(filePath, "new-name.new")

PRINT "\\n* No extension in new name"
filePath = "/my/path/file.ext"
PRINT filePath
PRINT File.SetName(filePath, "new-name")

PRINT "\\n* A path with no file name"
PRINT "* You could end up with an invalid path"
filePath = "/my/path/"
PRINT filePath
PRINT File.SetName(filePath, "new-name.new")

PRINT "\\n* A path with only a file name"
filePath = "file.ext"
PRINT filePath
PRINT File.SetName(filePath, "new-name.new")


* A standard type of path
/my/path/file.ext
/my/path/new-name.new

* No extension in new name
/my/path/file.ext
/my/path/new-name

* A path with no file name
* You could end up with an invalid path
/my/path/
/my/new-name.new

* A path with only a file name
file.ext
new-name.new