$ListIns Lstr: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
(Automatically generated page update)
 
(42 intermediate revisions by 3 users not shown)
Line 2: Line 2:
<span class="pageSubtitle">Insert string into a $list</span>
<span class="pageSubtitle">Insert string into a $list</span>


<p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $ListIns_Lstr function is the [[Insert (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 $ListIns_Lstr function is <var>[[Insert (Stringlist function)|Insert]]</var>.</p>


This function inserts longstring data into a $list. Generally, this $list would have been created with the $ListNew function.  
This function inserts longstring data into a $list. Generally, this $list would have been created with the <var>$ListNew</var> function.  


The $ListIns_Lstr function accepts three arguments and returns a numeric result. It is a callable $function (see [[Calling Sirius Mods $functions]]).  
The <var>$ListIns_Lstr</var> function accepts three arguments and returns a numeric result. It is a [[Calling Sirius Mods $functions|callable]] $function.  


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 the item number before which the longstring is to be inserted. If this argument is equal to the number of items in the $list plus one, the longstring is added to the end of the $list and so is, in this case, identical to a [[$ListAdd_Lstr]] Because the string is inserted before the indicated item number, this item number is also the item number of the new $list item after $ListIns_Lstr returns. This is a required argument.  
The second argument is the item number before which the longstring is to be inserted. If this argument is equal to the number of items in the $list plus one, the longstring is added to the end of the $list and so is, in this case, identical to a [[$ListAdd_Lstr]] Because the string is inserted before the indicated item number, this item number is also the item number of the new $list item after <var>$ListIns_Lstr</var> returns. This is a required argument.  


The third argument is a longstring that is to be inserted into the $list. This is a required argument.
The third argument is a longstring that is to be inserted into the $list. This is a required argument.


==Syntax==
==Syntax==
<p class="syntax"><section begin="syntax" /> [%RESULT =] $ListIns_Lstr(list_id, item_num, longstring)
<p class="syntax">[%RESULT =] $ListIns_Lstr(list_id, item_num, longstring)
<section end="syntax" /></p>
<p class="caption">$ListIns_Lstr Function
</p>
</p>
<p class="caption">%RESULT is set either to the number of items in the indicated $list after the string has been inserted into the $list, or to a negative number if an error has occurred.</p>
 
<p class="code">  
<p><var class="term">%result</var> is set either to the number of items in the indicated $list after the string has been inserted into the $list, or to a negative number if an error has occurred.</p>
-3 - No room to add item
 
(if LISTFC $SirParm parameter not set)
===Error codes===
All other errors result in request cancellation
<p class="code">-3 - No room to add item
</p>
(if LISTFC <var>$SirParm</var> parameter not set)
<p class="caption">$ListIns_Lstr Error Codes
All other errors result in request cancellation
</p>
</p>


Before <var class="product">[[Sirius Mods]]</var> Version 6.6, it was a request cancelling error to try to insert a longstring longer than the size limit of a Stringlist item: 6124 bytes. This limitation was eliminated in <var class="product">[[Sirius Mods]]</var> Version 6.6.
==Usage notes==
<ul>


<var>$ListIns_Lstr</var> works almost exactly like $ListIns except:
<li><var>$ListIns_Lstr</var> works almost exactly like <var>$ListIns</var> except:


<ol>
<ul>
<li>It accepts a LONGSTRING input. $ListIns_Lstr can be used with regular strings as well to pick up automatic request cancellation on programming errors.  
<li>It accepts a LONGSTRING input. <var>$ListIns_Lstr</var> can be used with regular strings as well to pick up automatic request cancellation on programming errors.  
<li>It cancels the request on any errors such as invalid $list identifier or invalid $list item number.  
<li>It cancels the request on any errors such as invalid $list identifier or invalid $list item number.  
<li>It does not have an item length argument (argument 4 in [[$ListIns]]).
<li>It does not have an item length argument (argument 4 in [[$ListIns]]).
</ol>
</ul>


A $ListIns_Lstr can result in the splitting of a $list leaf page. Once a leaf page is split, it will not be merged back together, even if subsequent $LISTREMs makes this possible. Because of this, heavy use of $ListIns_Lstr and $ListRem can result in "sparse&amp;CQ. $lists which place an unnecessary burden on the buffer pool and CCATEMP. 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.  
<li>A <var>$ListIns_Lstr</var> can result in the splitting of a $list leaf page. Once a leaf page is split, it will not be merged back together, even if subsequent $LISTREMs makes this possible. Because of this, heavy use of <var>$ListIns_Lstr</var> and <var>$ListRem</var> can result in "sparse&amp;CQ. $lists which place an unnecessary burden on the buffer pool and CCATEMP. 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>
<var>$ListIns_Lstr</var> is available in Version 6.2 and later of the <var class="product">[[Sirius Mods]]</var>.<p>


==Products authorizing {{PAGENAMEE}}==
<ul class="smallAndTightList">
<ul class="smallAndTightList">
<li>[[Sirius functions]]</li>
<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 class="caption">Products authorizing $ListIns_Lstr
</p>
[[Category:$Functions|$ListIns_Lstr]]
[[Category:$Functions|$ListIns_Lstr]]

Latest revision as of 22:51, 20 September 2018

Insert string into a $list

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

This function inserts longstring data into a $list. Generally, this $list would have been created with the $ListNew function.

The $ListIns_Lstr function accepts three 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 the item number before which the longstring is to be inserted. If this argument is equal to the number of items in the $list plus one, the longstring is added to the end of the $list and so is, in this case, identical to a $ListAdd_Lstr Because the string is inserted before the indicated item number, this item number is also the item number of the new $list item after $ListIns_Lstr returns. This is a required argument.

The third argument is a longstring that is to be inserted into the $list. This is a required argument.

Syntax

[%RESULT =] $ListIns_Lstr(list_id, item_num, longstring)

%result is set either to the number of items in the indicated $list after the string has been inserted into the $list, or to a negative number if an error has occurred.

Error codes

-3 - No room to add item (if LISTFC $SirParm parameter not set) All other errors result in request cancellation

Usage notes

  • $ListIns_Lstr works almost exactly like $ListIns except:
    • It accepts a LONGSTRING input. $ListIns_Lstr can be used with regular strings as well to pick up automatic request cancellation on programming errors.
    • It cancels the request on any errors such as invalid $list identifier or invalid $list item number.
    • It does not have an item length argument (argument 4 in $ListIns).
  • A $ListIns_Lstr can result in the splitting of a $list leaf page. Once a leaf page is split, it will not be merged back together, even if subsequent $LISTREMs makes this possible. Because of this, heavy use of $ListIns_Lstr and $ListRem can result in "sparse&CQ. $lists which place an unnecessary burden on the buffer pool and CCATEMP. 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 $ListIns_Lstr