CSplitpath:SetDrive CSplitpath:SetFilename

CSplitpath:SetExt


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

Syntax

bSuccess = CSplitpath:SetExt( sExtension )

 

bullet.gif    On success, this method returns true.

bullet.gif    On failure, this method returns false.

Example

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

S = new_splitpath()

-- create a CSplitpath object

S:SetPath(sPath)

-- set the starting path

S:SetExt(sNewExt)

-- assign a new file extension

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 class, GetExt


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