RemoveItem (Stringlist function): Difference between revisions
Jump to navigation
Jump to search
m (1 revision) |
m (1 revision) |
(No difference)
|
Revision as of 16:12, 19 January 2011
Remove item from Stringlist (Stringlist class)
This callable method removes an item from a Stringlist, decrementing the item numbers of all items which follow. If removal of an item makes a CCATEMP Stringlist page empty, that page is removed from use by the Stringlist. Otherwise, space taken up by a removed item is made available on the Stringlist page for other items in the same Stringlist.
Syntax
[%count =] sl:RemoveItem( itemNum)
Syntax terms
%rc | A numeric variable to contain the number of items remaining in the Stringlist after the item has been removed. |
---|---|
sl | A Stringlist object. |
itemnum | A number that specifies the item number in the Stringlist. |
Usage notes
- All errors in RemoveItem result in request cancellation.
- Consecutive Stringlist leaf pages that are made relatively empty with RemoveItem will not be merged together. Because of this, heavy use of Insert and RemoveItem can result in "sparse" Stringlists which place an unnecessary burden on the buffer pool and CCATEMP.
- Heavy use of Insert and RemoveItem can result in an inability to add an item to the end of the Stringlist (via the Add method) because of a full pointer page, even though the Stringlist is nowhere near the theoretical capacity for a Stringlist. To make matters worse, Copy does a page-for-page copy of a Stringlist, so it does not result in any compression of the resultant Stringlist. Stringlist compression can be achieved using the CopyItems (Stringlist function).