CSet:Insert
The Insert method adds a member to the Set prior to a specified index.
CSet:Insert( member, nIndex ) |
member is the object to insert.
nIdex is the index of the insertion point, beginning at 1.
The member is inserted before the member already existing at index. To insert prior to the beginning of the set, use index = 1. Insertion moves all the members down in the list to open up the new position at index. In comparison with insertion, the Add method adds a member at the end of the set and does not need to know the index.
Suppose a CSet exists with name S and that it contains 10 strings. The following script inserts a new string "ABC" at index 5:
|
-- result: Count = 10 |
|
-- Insert the new string at position 5 |
|
-- result: Count = 11 |