DeepCopy (SortedRecordset function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (Created page with "<span class="pageSubtitle"><section begin=dpl_desc/><section end=dpl_desc/></span> Copy and DeepCopy functions <p> <var>Copy</var> and <var>D...")
 
m (Created page with "<span class="pageSubtitle"><section begin=dpl_desc/><section end=dpl_desc/></span> Copy and DeepCopy functions <p> <var>Copy</var> and <var>D...")
Line 1: Line 1:
<span class="pageSubtitle"><section begin=dpl_desc/><section end=dpl_desc/></span>
{{Template:SortedRecordset:DeepCopy subtitle}}
[[Category:SortedRecordset methods|Copy and DeepCopy functions]]
<p>
<p>
<var>Copy</var> and <var>DeepCopy</var> are members of
<var>Copy</var> and <var>DeepCopy</var> are members of
Line 12: Line 11:
[[Copying objects#The Object class copy methods|"The Object class copy methods"]]).
[[Copying objects#The Object class copy methods|"The Object class copy methods"]]).
==Syntax==
==Syntax==
<p class="syntax">%newSRecs = %sRecs:Copy
{{Template:SortedRecordset:DeepCopy syntax}}
 
%newSRecs = %sRecs:DeepCopy
</p>
===Syntax terms===
===Syntax terms===
<table class="syntaxTable">
<table class="syntaxTable">
Line 24: Line 20:
<td>A <var>SortedRecordset</var> object variable. The variable can be null, in which case the output object will also be null.
<td>A <var>SortedRecordset</var> object variable. The variable can be null, in which case the output object will also be null.
</td></tr></table>
</td></tr></table>
==Usage Notes==
==Usage notes==
<ul>
<ul>
<li>Since a <var>SortedRecordset</var> object can't be modified once it's created,
<li>Since a <var>SortedRecordset</var> object can't be modified once it's created,
there generally isn't a good reason to make a copy of a <var>SortedRecordset</var>
there generally isn't a good reason to make a copy of a <var>SortedRecordset</var>
object &mdash; it makes more sense to just assign the reference to the
object &amp;mdash; it makes more sense to just assign the reference to the
<var>SortedRecordset</var> object.
<var>SortedRecordset</var> object.
The copy functionality for <var>SortedRecordsets</var> is mainly there to support <var>DeepCopy</var>
The copy functionality for <var>SortedRecordsets</var> is mainly there to support <var>DeepCopy</var>
Line 40: Line 36:
</p>
</p>
</ul>
</ul>
==See also==
{{Template:SortedRecordset:DeepCopy footer}}

Revision as of 01:24, 29 April 2011

Deep copy this SortedRecordset object (SortedRecordset class)

Copy and DeepCopy are members of the SortedRecordset class.


These functions make a copy of a SortedRecordset object. The DeepCopy function is identical to Copy, but flags the SortedRecordset class as "deep-copyable" (as these terms are described in "The Object class copy methods").

Syntax

%outSortedRecordset = sortedRecordset:DeepCopy

Syntax terms

%newSRecs A SortedRecordset object created by this method that contains a copy of the method object.
%sRecs A SortedRecordset object variable. The variable can be null, in which case the output object will also be null.

Usage notes

  • Since a SortedRecordset object can't be modified once it's created, there generally isn't a good reason to make a copy of a SortedRecordset object &mdash; it makes more sense to just assign the reference to the SortedRecordset object. The copy functionality for SortedRecordsets is mainly there to support DeepCopy of SortedRecordset objects to facilitate passing of these objects to and from daemons.
  • The following example illustrates the use of the Copy function:

    %sorted is object sortedRecordset in file geeks %sortedCopy is object sortedRecordset in file geeks ... %sortedCopy = %sorted:copy

See also