CSet Class Definition CSet:Copy

new_set


The new_set function is a non-class version of the CSet:new method which creates and returns a new CSet object..

Syntax

S = new_set()

bullet.gif    Default constructor. The new CSet S has no elements.

S = new_set( CSet_old )

bullet.gif    This is a copy constructor. The new CSet S is initialized to the members of the CSet_old argument.

Example

The following example shows the use of a default constructor and destructor pair:

S = new_set()

-- create a new instance of S of the CSet class.

  ...

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

S:delete()

-- deletes the object and its associated memory.

The next example shows the use of both types of constructors:

S = new_set()

-- initialization constructor

S:Append( "Add" )

-- add a member

S:Append( "Mul" )

-- add a member

S:Append( "Div" )

-- add a member

Printf("Count= %d", S:Count())

-- result: Count = 3

S2 = new_set(S)

-- copy constructor

Printf("Count= %d", S2:Count())

-- result: Count = 3

Related Topics

CSet

Copy

new

delete


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