$ListAdd Lstr: Difference between revisions

From m204wiki
Jump to navigation Jump to search
(Automatically generated page update)
(Automatically generated page update)
 
(14 intermediate revisions by 2 users not shown)
Line 2: Line 2:
<span class="pageSubtitle">Add longstring as new $list item</span>
<span class="pageSubtitle">Add longstring as new $list item</span>


<p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $ListAdd_Lstr function is the [[Add (Stringlist function)]]. Note that because Stringlists are longstring capabable, no special longstring methods are required.</p>
<p class="warn"><b>Note: </b>Many $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $ListAdd_Lstr function is the <var>[[Add (Stringlist function)|Add]]</var> function. Note that because Stringlists are longstring capabable, no special longstring methods are required.</p>


This function adds longstring data to a $list. Generally, this $list would have been created with the [[$ListNew]] function.  
This function adds longstring data to a $list. Generally, this $list would have been created with the [[$ListNew]] function.  
Line 15: Line 15:
<p class="syntax">[%RESULT =] $ListAdd_Lstr(list_identifier, string)
<p class="syntax">[%RESULT =] $ListAdd_Lstr(list_identifier, string)
</p>
</p>
<p>
</p>
<p>%result is set either to the number of items in the indicated $list after the string has been added to the $list, or to a negative number if an error has occurred. Note that in the former case, %result is also the item number associated with the added string in the $list.</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 added to the $list, or to a negative number if an error has occurred. Note that in the former case, %result is also the item number associated with the added string in the $list.</p>
-3 - No room to add item
 
      (if LISTFC <var>$SirParm</var> parameter not set)
===Error Codes===
All other errors cause request cancellation
<p class="code">-3 - No room to add item
</p>
      (if LISTFC <var>$SirParm</var> parameter not set)
<p class="caption">$ListAdd_Lstr Error Codes
All other errors cause request cancellation
</p>
</p>


Before <var class="product">[[Sirius Mods]]</var> Version 6.6, it was a request cancelling error to try to add a longstring longer than the size limit of a $list item: 6124 bytes. This limitation was eliminated in <var class="product">[[Sirius Mods]]</var> Version 6.6.
==Usage notes==
 
<ul>
<var>$ListAdd_Lstr</var> works almost exactly like <var>$ListAdd</var> except:
<li><var>$ListAdd_Lstr</var> works almost exactly like <var>$ListAdd</var> except:


<ol>
<ul>
<li>It accepts a LONGSTRING input. <var>$ListAdd_Lstr</var> can be used with regular strings as well to pick up automatic request cancellation on programming errors.  
<li>It accepts a LONGSTRING input. <var>$ListAdd_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 3 in $ListAdd).
<li>It does not have an item length argument (argument 3 in $ListAdd).
</ol>
</ul>
 
</ul>
<var>$ListAdd_Lstr</var> is available in <var class="product">[[Sirius Mods]]</var> Version 6.2 and later.<p>


==Products authorizing {{PAGENAMEE}}==  
==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>
</p>
[[Category:$Functions|$ListAdd_Lstr]]
[[Category:$Functions|$ListAdd_Lstr]]

Latest revision as of 22:51, 20 September 2018

Add longstring as new $list item

Note: Many $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $ListAdd_Lstr function is the Add function. Note that because Stringlists are longstring capabable, no special longstring methods are required.

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

The $ListAdd_Lstr 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 longstring that is to be added to the $list. This is a required argument.

Syntax

[%RESULT =] $ListAdd_Lstr(list_identifier, string)

%result is set either to the number of items in the indicated $list after the string has been added to the $list, or to a negative number if an error has occurred. Note that in the former case, %result is also the item number associated with the added string in the $list.

Error Codes

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

Usage notes

  • $ListAdd_Lstr works almost exactly like $ListAdd except:
    • It accepts a LONGSTRING input. $ListAdd_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 3 in $ListAdd).

Products authorizing $ListAdd_Lstr