CSplitpath:SetFilenameExt CSplitpath:SetName

CSplitpath:SetFolder


The SetFolder method sets the folder component of the CSplitpath object. In The folder consists of the machine name, drive name, and directory. Use Merge to combine this component and the other components into a full path.

Syntax

bSuccess = CSplitpath:SetFolder( sFolder )

 

    On success, this method returns true.

    On failure, this method returns false.

Example

Suppose a file exists with a full path named sPath. The following script fragment creates a new path using a different folder named sNewFolder:

 

S = CSplitpath:new()

-- create a CSplitpath object

S:SetPath(sPath)

-- set the starting path

S:SetFolder(sNewFolder)

-- assign a new folder component

S:Merge()

-- combine the path components

  ...

-- do something with the new path

S:delete()

-- when done with S, remove it from memory

Related Topics

CSplitpath, GetFolder