$ListRep Lstr: Difference between revisions
m (1 revision) |
m (1 revision) |
||
Line 31: | Line 31: | ||
Before <var class="product">[[Sirius Mods]]</var> Version 6.6, it was a request cancelling error to try to replace a Stringlist item with 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. | Before <var class="product">[[Sirius Mods]]</var> Version 6.6, it was a request cancelling error to try to replace a Stringlist item with 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. | ||
$ListRep_Lstr works almost exactly like [[$ListRep]] except: | <var>$ListRep_Lstr</var> works almost exactly like [[$ListRep]] except: | ||
<ol> | <ol> | ||
Line 39: | Line 39: | ||
</ol> | </ol> | ||
$ListRep_Lstr is extremely efficient if the $list item size is not being changed (return value for $ListRep_Lstr of 0), fairly efficient when a $list item is being replaced with a shorter string (return value of 1) and can be fairly expensive when a $list item is being replaced with a longer string (return value of 2). The latter case can be expensive because such a $ListRep_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 [[$ListRem]]s makes this possible. Because of this, heavy use of $LISREP_LSTRs that increase $list item size (and [[$ListIns]] and [[$ListRem]]) can result in "sparse" $lists which place an unnecessary burden on the buffer pool and CCATEMP. $List compression can be done using the [[$List_Copy_Items]] function. | <var>$ListRep_Lstr</var> is extremely efficient if the $list item size is not being changed (return value for $ListRep_Lstr of 0), fairly efficient when a $list item is being replaced with a shorter string (return value of 1) and can be fairly expensive when a $list item is being replaced with a longer string (return value of 2). The latter case can be expensive because such a $ListRep_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 [[$ListRem]]s makes this possible. Because of this, heavy use of $LISREP_LSTRs that increase $list item size (and [[$ListIns]] and [[$ListRem]]) can result in "sparse" $lists which place an unnecessary burden on the buffer pool and CCATEMP. $List compression can be done using the [[$List_Copy_Items]] function. | ||
$ListRep_Lstr is available in Version 6.2 and later of the <var class="product">[[Sirius Mods]]</var>.<p> | <var>$ListRep_Lstr</var> is available in Version 6.2 and later of the <var class="product">[[Sirius Mods]]</var>.<p> | ||
<ul class="smallAndTightList"> | <ul class="smallAndTightList"> |
Revision as of 23:44, 18 October 2012
Replace a $list item with a longstring
Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $ListRep_Lstr function is the Replace (Stringlist function).
This function replaces an existing $list item with a longstring. Generally, this $list would have been created with the $ListNew function.
The $ListRep_Lstr function accepts three 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 the item number which is to be replaced. This is a required argument.
The third argument is a string that is to replace the $list item indicated by the second argument. This is a required argument.
Syntax
<section begin="syntax" /> [%RESULT =] $ListRep_Lstr(list_identifier, item_num, 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 replace a Stringlist item with a longstring longer than the size limit of a Stringlist item: 6124 bytes. This limitation was eliminated in Sirius Mods Version 6.6.
$ListRep_Lstr works almost exactly like $ListRep except:
- It accepts a longstring input. $ListRep_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 $ListRep).
$ListRep_Lstr is extremely efficient if the $list item size is not being changed (return value for $ListRep_Lstr of 0), fairly efficient when a $list item is being replaced with a shorter string (return value of 1) and can be fairly expensive when a $list item is being replaced with a longer string (return value of 2). The latter case can be expensive because such a $ListRep_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 $LISREP_LSTRs that increase $list item size (and $ListIns and $ListRem) can result in "sparse" $lists which place an unnecessary burden on the buffer pool and CCATEMP. $List compression can be done using the $List_Copy_Items function.
$ListRep_Lstr is available in Version 6.2 and later of the Sirius Mods.