CSplitpath:Split


The Split method assigns a path name to the CSplitpath object and splits it into its components.

Syntax

bSuccess = CSplitpath:Split( sPath )

where

 

    sPath is the new path.

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

  

This is essentially an alias for the SetPath method but SetPath is usually used right after new, whereas Split is normally used after working on the path components.

Example

Suppose a file exists with a full path named sPath. The following script assigns a new path to the existing CSplitpath object and splits it into components:

S = CSplitpath:new( sPath )

-- create a CSplitpath object for path sPath

S:Split( sNewPath )

-- assign a new path and split it into components

Related Topics

Merge

CSplitpath class