CSplitpath:new


The new method creates an instance of the CSplitpath class. Two constructors are available..

Note: This method's name uses all lower case to present it as the analog of the C++ new operator. Generally, the names of class methods begin with an uppercase letter but new and delete are different.

Syntax

S = CSplitpath:new( sPath )

S = CSplitpath:new( sString )

where

 

    If no argument is passed, a new CSplitpath object is created. the object is initially empty. With this constructor, there is no path until SetPath or Split is called.

    sString is a string containing a path name. When this argument is passed, a new CSplitpath object is created with the path split into components of sString. In this form, SetPath and Split are not needed unless you want to change the path.

    S is a new CSplitpath object. On failure, nil is returned.

Example

 

S = CSplitpath:new( sPath )

-- create a new CSplitpath for the string sPath

  --

-- other uses of the class go here, between new and delete.

S:delete()

-- deletes the object and its associated memory.

Related Topics

delete

Split

Merge

CSplitpath class