CSplitpath:SetExt CSplitpath:SetFilenameExt

CSplitpath:SetFilename


The SetFilename method sets the file name component of the CSplitpath object. Use Merge to combine this component and the other components into a full path.

Syntax

bSuccess = CSplitpath:SetFilename( sName )

 

Example

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

 

S = CSplitpath:new()

-- create a CSplitpath object

S:SetPath(sPath)

-- set the starting path

S:SetFilename(sNewName)

-- assign a new file name

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, GetFilename