This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v19.8
folder.moveTo( )
|
folder.moveTo ( destinationFolder {; newName} ) -> Result | ||||||||
Parameter | Type | Description | ||||||
destinationFolder | Object |
![]() |
Destination folder | |||||
newName | Text |
![]() |
Name for the moved folder | |||||
Result | Object |
![]() |
Moved folder | |||||
The folder.moveTo( ) method moves or renames the Folder object (source folder) into the specified destinationFolder.
The destinationFolder must exist on disk, otherwise an error is generated.
By default, the folder retains its name when moved. If you want to rename the moved folder, pass the new name in the newName parameter. The new name must comply with naming rules (e.g,. it must not contain characters such as ":", "/", etc.), otherwise an error is returned.
Returned object
The method returns the moved Folder object.
You want to move and rename a folder:
C_OBJECT($tomove;$moved)
$docs:=Folder(fk documents folder)
$tomove:=$docs.folder("Pictures")
$tomove2:=$tomove.moveTo($docs.folder("Archives");"Pic_Archives")
Product: 4D
Theme: File and Folder
Created: 4D v17 R5
4D Language Reference ( 4D v19)
4D Language Reference ( 4D v19.1)
4D Language Reference ( 4D v19.4)
4D Language Reference ( 4D v19.5)
4D Language Reference ( 4D v19.6)
4D Language Reference ( 4D v19.7)
4D Language Reference ( 4D v19.8)