首页 > comp > gb > file > setdir 
 en fr de es it nl pl pt pt_BR mk sq ca hu cs tr ar fa id vi ko ja ru zh eo
前一个  下一个  编辑  重命名  撤销  搜索  管理  
文档  
警告! 该页面未翻译。  参见英文版 
File.SetDir (gb)
Static Function SetDir ( Path As String, NewDir As String ) As String

Sets the directory part of a path, and returns the modified path.

Example

DIM filePath AS String

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

PRINT "\\n* Set a relative path"
filePath = "my/path/file.ext"
PRINT filePath
PRINT File.SetDir(filePath, "new/path")

PRINT "\\n* Add a path to a file and extension"
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/")


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

* Set a relative path
my/path/file.ext
new/path/file.ext

* Add a path to a file and extension
file.ext
/new/path/file.ext

* Change a path without a file name and extension
my/path/
new/path/