$ListRem: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
(Automatically generated page update)
 
(19 intermediate revisions by 3 users not shown)
Line 2: Line 2:
<span class="pageSubtitle">Remove item from $list</span>
<span class="pageSubtitle">Remove item from $list</span>


<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>
<p class="warn"><b>Note: </b>Many $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $ListRem function is <var>[[RemoveItem (Stringlist function)|RemoveItem]]</var>.</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.  
Line 13: Line 13:


==Syntax==
==Syntax==
<p class="syntax"><section begin="syntax" />[%RESULT =] $ListRem(list_identifier, item_num)
<p class="syntax">[%RESULT =] $ListRem(list_identifier, item_num)
<section end="syntax" /></p>
<p>
</p>
</p>
<p>%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><var class="term">%result</var> is the number of items remaining in the $list after the removal, or is a negative number if an error has occurred.</p>
-5 - Required argument not specified
 
-6 - $List identifier invalid
===Error codes===
-7 - Item number not found in $list
<p class="code">-5 - Required argument not specified
</p>
-6 - $List identifier invalid
<p class="caption">$ListRem Error Codes
-7 - Item number not found in $list
</p>
</p>


Consecutive $list leaf pages that are made relatively empty with <var>$ListRem</var> will not be merged together. Because of this, heavy use of [[$ListIns]] and <var>$ListRem</var> 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, <var>$ListCpy</var> 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>
==Usage notes==
<ul>
<li>Consecutive $list leaf pages that are made relatively empty with <var>$ListRem</var> will not be merged together. Because of this, heavy use of [[$ListIns]] and <var>$ListRem</var> 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, <var>$ListCpy</var> 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.
</ul>


<h2>Products authorizing {{PAGENAMEE}}</h2><ul class="smallAndTightList">
==Products authorizing {{PAGENAMEE}}==
<li>[[Sirius functions]]</li>
<ul class="smallAndTightList">
<li>[[List of $functions|Sirius functions]]</li>
<li>[[Fast/Unload User Language Interface]]</li>
<li>[[Fast/Unload User Language Interface]]</li>
<li>[[Janus Open Client]]</li>
<li>[[Media:JoclrNew.pdf|Janus Open Client]]</li>
<li>[[Janus Open Server]]</li>
<li>[[Media:JosrvrNew.pdf|Janus Open Server]]</li>
<li>[[Janus Sockets]]</li>
<li>[[Janus Sockets]]</li>
<li>[[Janus Web Server]]</li>
<li>[[Janus Web Server]]</li>
<li>[[Japanese functions]]</li>
<li>Japanese functions</li>
<li>[[Sir2000 Field Migration Facility]]</li>
<li>[[Media:SirfieldNew.pdf|Sir2000 Field Migration Facility]]</li>
 
</ul>
</ul>
   
   
</p>
<p>
</p>
[[Category:$Functions|$ListRem]]
[[Category:$Functions|$ListRem]]

Latest revision as of 22:51, 20 September 2018

Remove item from $list

Note: Many $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $ListRem function is RemoveItem.

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 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. 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

[%RESULT =] $ListRem(list_identifier, item_num)

%result is the number of items remaining in the $list after the removal, or is a negative number if an error has occurred.

Error codes

-5 - Required argument not specified -6 - $List identifier invalid -7 - Item number not found in $list

Usage notes

  • 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.

Products authorizing $ListRem