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 )

where

 

    sFolder is the new folder name.

    bSuccess is the returned success code. On success it is true, otherwise false.

Example

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

S = CSplitpath:new( sPath )

-- create a CSplitpath object for path sPath

s = "//MyName/C:/MyDir1/MyDir2"

-- setup a folder name

S:SetFolder( s )

-- assign a new folder component

S:Merge()

-- combine the path components

Related Topics

GetFolder

CSplitpath class