Copy (Stringlist function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
 
mNo edit summary
Line 1: Line 1:
<span style="font-size:120%"><b>Copy Stringlist</b></span>
{{Template:Stringlist:Copy subtitle}}


This method copies an entire Stringlist, creating a new Stringlist. The Copy method accepts no argument and returns a Stringlist object.  If you are new to object-oriented programming or the Janus APIs you should read about [[Copying objects]].
This method copies an entire Stringlist, creating a new Stringlist. The Copy method accepts no argument and returns a Stringlist object.  If you are new to object-oriented programming or the Janus APIs you should read about [[Copying objects]].
Line 5: Line 5:
Copy is a member of the [[Stringlist class]].
Copy is a member of the [[Stringlist class]].


==Copy Syntax==
==Syntax==
<pre>
{{Template:Stringlist:Copy syntax}}
%outlist = %sl:Copy
===Syntax terms===
</pre>
 
==Syntax Terms==
<dl>
<dl>
<dt>%outlist<dd>A Stringlist to contain the copy of the method Stringlist '''%sl'''<dt>%sl<dd>A Stringlist object.  
<dt>%outlist<dd>A Stringlist to contain the copy of the method Stringlist '''%sl'''<dt>%sl<dd>A Stringlist object.  
</dl>
</dl>


==Usage Notes==
==Usage notes==
<ul>
<ul>
<li>All errors in Copy result in request cancellation.
<li>All errors in Copy result in request cancellation.

Revision as of 17:40, 31 December 2010

Copy Stringlist (Stringlist class)


This method copies an entire Stringlist, creating a new Stringlist. The Copy method accepts no argument and returns a Stringlist object. If you are new to object-oriented programming or the Janus APIs you should read about Copying objects.

Copy is a member of the Stringlist class.

Syntax

%outList = sl:Copy

Syntax terms

%outlist
A Stringlist to contain the copy of the method Stringlist %sl
%sl
A Stringlist object.

Usage notes

  • All errors in Copy result in request cancellation.
  • If the method Stringlist was associated with an image, by either the BindImage or New method, the output Stringlist is associated with the same image, as if a BindImage method had been invoked on the result of the Copy method.
  • Copy does a page-for-page copy of the input Stringlist. As such, it is very efficient (more efficient than CopyItems), but it is also useless for compressing a Stringlist that has become sparse as the result of heavy Insert, Replace, ChangeItemLength, and RemoveItem activity. Replace and ChangeItemLength cause a Stringlist to become sparse only if Stringlist items are replaced with larger Stringlist items or increased in size. For list compression, use CopyItems (Stringlist function).