CArray:Empty
The Empty method deletes all members of the CArray but does not delete the CArray object.
CArray:Empty() |
This deletes all array members without deleting the CArray object itself. If you delete the CArray, the object is set to nil and cannot be used again without creating a new instance using new. By calling Empty, the existing CArray can be used to Set new members, and so forth.
The following script fragment sets 3 members in a new CArray M, then deletes all members of M:
|
-- create a CArray |
|
-- set member |
|
-- set member |
|
-- set member |
|
-- result: Members = 3 |
|
-- empty the array |
|
-- result: Members = 0 |
|
-- if finished with A, clean up memory |