CSplitpath:Merge


The Merge method combines the path components in a CSplitpath object into a single path. The resulting path string is returned.

Syntax

sString = CSplitpath:Merge()

 

bullet.gif    On success, this method returns the full path as a string.

bullet.gif    On failure, this method returns nil.

Example

Suppose a file exists with a full path named sPath. The script below changed the file name and extension to the string sNewName and merges the components back into a full path:

S = new_splitpath( sPath )

-- create a CSplitpath object for the string sPath

S:SetFilenameExt( sNewName )

-- change the file name and extension

sNewPath = S:Merge(sPath)

-- merge components into a new path, sNewPath

 

-- use the path name ...

S:delete()

-- when done with S, remove it from memory

Related Topics

CSplitpath class, Split


Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics, Inc. All Rights Reserved.