CSplitpath:GetName


The GetName method returns the file name from a CSplitpath object. The name does not include the directory or file extension.

Syntax

sName = CSplitpath:GetName()

 

bullet.gif    On success, this method returns a string containing the file name.

bullet.gif    On failure, this method returns nil.

Example

Suppose a file exists with a full path named sPath. The following script retrieves the folder component:

S = new_splitpath()

-- create a CSplitpath object

S:SetPath(sPath)

-- Specify the path to be split

sName = S:GetName()

-- assigns the file name component to sName

S:delete()

-- when done with S, remove it from memory

Related Topics

CSplitpath class


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