$List Copy Items: Difference between revisions
(Automatically generated page update) |
(Automatically generated page update) |
||
(One intermediate revision by the same user not shown) | |||
Line 2: | Line 2: | ||
<span class="pageSubtitle">Copy items between $lists</span> | <span class="pageSubtitle">Copy items between $lists</span> | ||
<p class="warn"><b>Note: </b> | <p class="warn"><b>Note: </b>Many $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $List_Copy_Items function is <var>[[CopyItems (Stringlist function)|CopyItems]]</var>.</p> | ||
This function copies items from one $list to another. Both the input and output $lists can be created by any of the $list creating functions. The copied items are appended to the end of the output $list. | This function copies items from one $list to another. Both the input and output $lists can be created by any of the $list creating functions. The copied items are appended to the end of the output $list. | ||
Line 52: | Line 52: | ||
<li>[[Janus Web Server]]</li> | <li>[[Janus Web Server]]</li> | ||
<li>Japanese functions</li> | <li>Japanese functions</li> | ||
<li>[[Media:SirfieldNew.pdf|Sir2000 Field Migration Facility]</li> | <li>[[Media:SirfieldNew.pdf|Sir2000 Field Migration Facility]]</li> | ||
</ul> | </ul> | ||
[[Category:$Functions|$List_Copy_Items]] | [[Category:$Functions|$List_Copy_Items]] |
Latest revision as of 22:51, 20 September 2018
Copy items between $lists
Note: Many $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $List_Copy_Items function is CopyItems.
This function copies items from one $list to another. Both the input and output $lists can be created by any of the $list creating functions. The copied items are appended to the end of the output $list.
The $List_Copy_Items function accepts four arguments and returns a numeric result. It is a callable $function.
The first argument is the identifier of the output $list. This is a required argument.
The second argument is the identifier of the input $list. This is a required argument.
The third argument is a number that is the starting item number in the input $list from which items are to be copied. This is an optional argument and defaults to the first item in the input $list if not specified.
The fourth argument is a number that is the number of items from the input $list that are to be copied. This is an optional argument and defaults to the number of items in the input $list after and including the starting item number. If set to a number greater than the number of items after and including the starting item number, all items after and including the starting item number are copied. A zero value for this argument is treated the same as if it were not specified.
Syntax
[%RESULT =] $List_Copy_Items(list_id_output, list_id_input, - start_item, num_items)
%result is set either to the number of items in the output $list after the function is completed, or to a negative error code.
-3 - No room in CCATEMP -5 - Required argument not specified -6 - $List identifier invalid -7 - Invalid starting item number -8 - Invalid item count
$List_Copy_Items does an item for item copy so can be used to compress a $list that has become sparse as the result of heavy $ListIns, $ListRep, $ListAdj and/or $ListRem activity. $ListRep and $ListAdj will only cause a $list to become sparse if $list items are replaced with larger $list items or increased in size. The following chunk of code shows how $list %LIST can be compressed:
%CLIST = $ListNew %RC = $List_Copy_Items(%CLIST, %LIST) %RC = $ListMove(%LIST, %CLIST)
If copying an entire $list and no compression is required, $ListCpy is more efficient than $List_Copy_Items because the former does a page for page copy while the latter does an item for item copy.