$ListAdd Lstr: Difference between revisions
m (1 revision) |
mNo edit summary |
||
Line 2: | Line 2: | ||
<span class="pageSubtitle"><section begin="desc" />Add longstring as new $list item<section end="desc" /></span> | <span class="pageSubtitle"><section begin="desc" />Add longstring as new $list item<section end="desc" /></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 [[ | <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> | ||
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. | ||
The $ListAdd_Lstr function accepts two arguments and returns a numeric result. It is a callable $function ( | The $ListAdd_Lstr 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 longstring that is to be added to the $list. 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== | ==Syntax== | ||
<p class="syntax"><section begin="syntax" /> [%RESULT =] $ListAdd_Lstr(list_identifier, string) | <p class="syntax"><section begin="syntax" /> [%RESULT =] $ListAdd_Lstr(list_identifier, string) | ||
Line 17: | Line 18: | ||
</p> | </p> | ||
<p class="caption">%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="caption">%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 class="code"> | ||
-3 - No room to add item | -3 - No room to add item | ||
(if LISTFC $SirParm parameter not set) | |||
All other errors cause request cancellation | All other errors cause request cancellation | ||
</p> | </p> | ||
<p class="caption">$ListAdd_Lstr Error Codes | <p class="caption">$ListAdd_Lstr Error Codes | ||
</p> | </p> | ||
Before ''[[Sirius Mods]]'' 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 ''[[Sirius Mods]]'' Version 6.6. | Before ''[[Sirius Mods]]'' 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 ''[[Sirius Mods]]'' Version 6.6. | ||
$ListAdd_Lstr works almost exactly like $ListAdd except: | $ListAdd_Lstr works almost exactly like $ListAdd except: | ||
<ol> | <ol> | ||
<li>It accepts a LONGSTRING input. $ListAdd_Lstr can be used with regular strings as well to pick up automatic request cancellation on programming errors. | <li>It accepts a LONGSTRING input. $ListAdd_Lstr 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> | </ol> | ||
$ListAdd_Lstr is available in ''[[Sirius Mods]]'' Version 6.2 and later.<p> | $ListAdd_Lstr is available in ''[[Sirius Mods]]'' Version 6.2 and later.<p> |
Revision as of 13:26, 9 February 2011
<section begin="desc" />Add longstring as new $list item<section end="desc" />
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.
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 (see Calling Sirius Mods $functions).
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
<section begin="syntax" /> [%RESULT =] $ListAdd_Lstr(list_identifier, string) <section end="syntax" />
-3 - No room to add item (if LISTFC $SirParm parameter not set) All other errors cause request cancellation
Before Sirius Mods 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 Sirius Mods Version 6.6.
$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).
$ListAdd_Lstr is available in Sirius Mods Version 6.2 and later.