$ListRem: Difference between revisions
m (1 revision) |
mNo edit summary |
||
Line 2: | Line 2: | ||
<span class="pageSubtitle"><section begin="desc" />Remove item from $list<section end="desc" /></span> | <span class="pageSubtitle"><section begin="desc" />Remove item from $list<section end="desc" /></span> | ||
<p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $ListRem function is [[ | <p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $ListRem function is the [[RemoveItem (Stringlist function)]].</p> | ||
This function removes an item from a $list, decrementing the item numbers of all items which follow. | This function removes an item from a $list, decrementing the item numbers of all items which follow. | ||
The $ListRem function accepts two arguments and returns a numeric result. It is a callable $function ( | The $ListRem function accepts two arguments and returns a numeric result. It is a callable $function (see [[Calling Sirius Mods $functions]]). | ||
The first argument is a $list identifier. This is a required argument. | The first argument is a $list identifier. This is a required argument. | ||
The second argument is a number that specifies the item number in the $list. This is a required argument. p. The number of items remaining in the $list after the removal is returned as the result of this function. If removal of an item makes a CCATEMP $list page empty, that page is removed from use by the $list. Except for sorted lists which are only one page in size, space taken up by the removed item is made available on the $list page. If there are no items remaining after the removal, the $list is deleted. | The second argument is a number that specifies the item number in the $list. This is a required argument. p. The number of items remaining in the $list after the removal is returned as the result of this function. If removal of an item makes a CCATEMP $list page empty, that page is removed from use by the $list. Except for sorted lists which are only one page in size, space taken up by the removed item is made available on the $list page. If there are no items remaining after the removal, the $list is deleted. | ||
==Syntax== | ==Syntax== | ||
<p class="syntax"><section begin="syntax" /> [%RESULT =] $ListRem(list_identifier, item_num) | <p class="syntax"><section begin="syntax" /> [%RESULT =] $ListRem(list_identifier, item_num) | ||
Line 17: | Line 18: | ||
</p> | </p> | ||
<p class="caption">%RESULT is the number of items remaining in the $list after the removal, or is a negative number if an error has occurred.</p> | <p class="caption">%RESULT is the number of items remaining in the $list after the removal, or is a negative number if an error has occurred.</p> | ||
<p class="code"> | <p class="code"> | ||
-5 - Required argument not specified | -5 - Required argument not specified | ||
Line 25: | Line 27: | ||
</p> | </p> | ||
Consecutive $list leaf pages that are made relatively empty with $ListRem will not be merged together. Because of this, heavy use of [[$ListIns]] and $ListRem can result in "sparse" $lists which place an unnecessary burden on the buffer pool and CCATEMP. It can also result in an inability to add an item to the end of the $list (via [[$ListAdd]]) because of a full pointer page, even though the $list is nowhere near the theoretical capacity for a $list. To make matters worse, $ListCpy does a page-for-page copy of a $list so does not result in any compression of the resultant $list. $List compression can be done using the [[$List_Copy_Items]] function.<p> | |||
Consecutive $list leaf pages that are made relatively empty with $ListRem will not be merged together. Because of this, heavy use of $ListIns and $ListRem can result in "sparse | |||
<ul class="smallAndTightList"> | <ul class="smallAndTightList"> | ||
Line 43: | Line 44: | ||
<p class="caption">Products authorizing $ListRem | <p class="caption">Products authorizing $ListRem | ||
</p> | </p> | ||
[[Category:$Functions|$ListRem]] | [[Category:$Functions|$ListRem]] |
Revision as of 15:53, 10 February 2011
<section begin="desc" />Remove item from $list<section end="desc" />
Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $ListRem function is the RemoveItem (Stringlist function).
This function removes an item from a $list, decrementing the item numbers of all items which follow.
The $ListRem function accepts two arguments and returns a numeric result. It is a callable $function (see Calling Sirius Mods $functions).
The first argument is a $list identifier. This is a required argument.
The second argument is a number that specifies the item number in the $list. This is a required argument. p. The number of items remaining in the $list after the removal is returned as the result of this function. If removal of an item makes a CCATEMP $list page empty, that page is removed from use by the $list. Except for sorted lists which are only one page in size, space taken up by the removed item is made available on the $list page. If there are no items remaining after the removal, the $list is deleted.
Syntax
<section begin="syntax" /> [%RESULT =] $ListRem(list_identifier, item_num) <section end="syntax" />
-5 - Required argument not specified -6 - $List identifier invalid -7 - Item number not found in $list
Consecutive $list leaf pages that are made relatively empty with $ListRem will not be merged together. Because of this, heavy use of $ListIns and $ListRem can result in "sparse" $lists which place an unnecessary burden on the buffer pool and CCATEMP. It can also result in an inability to add an item to the end of the $list (via $ListAdd) because of a full pointer page, even though the $list is nowhere near the theoretical capacity for a $list. To make matters worse, $ListCpy does a page-for-page copy of a $list so does not result in any compression of the resultant $list. $List compression can be done using the $List_Copy_Items function.