CSet:RemoveAt


The RemoveAt method removes a member from the CSet by its index position in the set.

Syntax

member = CSet:RemoveAt( index )

bullet.gif    index specifies the index of the member to remove.

bullet.gif    member is the set member that was removed.

bullet.gif    On success, this method returns the removed member.

bullet.gif    On failure, nil is returned.

Remarks

This method removes the member at an index. In comparison, the Remove method removes the set member by matching its value to set members. Removing a set member decreases the list length by 1 member. Removal does not delete the CImage or its associated image.

Example

Suppose a CSet exists with name S and that it contains 10 values. The following script removes from the list the member at index 5:

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

-- result: count=10

S:RemoveAt( 5 )

-- remove the member at index 5

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

-- result: count=9

Related Topics

CSet, Remove, RemoveFirst, RemoveLast


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