DeepCopy (SortedRecordset function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
mNo edit summary
Line 1: Line 1:
{{Template:SortedRecordset:DeepCopy subtitle}}
{{Template:SortedRecordset:DeepCopy subtitle}}
<p>
<var>Copy</var> and <var>DeepCopy</var> are members of
the <var>[[SortedRecordset class|SortedRecordset]]</var> class.
</p>


 
This function makes a deep copy of a <var>SortedRecordset</var> object.
These functions make a copy of a <var>SortedRecordset</var> object.
The <var>DeepCopy</var> function  is identical to <var>[[Copy (SortedRecordset function)|Copy]]</var>, but it flags the <var>SortedRecordset</var> class as "deep-copyable" (as these terms are described in
The <var>DeepCopy</var> function  is identical to <var>Copy</var>, but flags the <var>SortedRecordset</var>
class as "deep-copyable" (as these terms are described in
[[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==
Line 14: Line 8:
===Syntax terms===
===Syntax terms===
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th>%newSRecs</th>
<tr><th>%outSortedRecordset</th>
<td>A <var>SortedRecordset</var> object created by this method that contains a copy of the method object.
<td>A <var>SortedRecordset</var> object created by this method that contains a copy of the method object.
</td></tr>
</td></tr>
<tr><th>%sRecs</th>
<tr><th>sortedRecordset</th>
<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>
Line 24: Line 18:
<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 &amp;mdash; it makes more sense to just assign the reference to the
object &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>
of <var>SortedRecordset</var> objects to facilitate passing of these objects to and
of <var>SortedRecordset</var> objects to facilitate passing of these objects to and
from [[Daemon class|daemons]].
from [[Daemon class|daemons]].
<li>The following example illustrates the use of the <var>Copy</var> function:
<li>The following example illustrates the use of the <var>DeepCopy</var> function:
<p class="code"> %sorted        is object sortedRecordset in file geeks
<p class="code"> %sorted        is object sortedRecordset in file geeks
  %sortedCopy     is object sortedRecordset in file geeks
  %sortedDCopy     is object sortedRecordset in file geeks
   ...
   ...
  %sortedCopy = %sorted:copy
  %sortedDCopy = %sorted:deepCopy
</p>
</p>
</ul>
</ul>
==See also==
==See also==
{{Template:SortedRecordset:DeepCopy footer}}
{{Template:SortedRecordset:DeepCopy footer}}

Revision as of 02:04, 29 April 2011

Deep copy this SortedRecordset object (SortedRecordset class)


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

Syntax

%outSortedRecordset = sortedRecordset:DeepCopy

Syntax terms

%outSortedRecordset A SortedRecordset object created by this method that contains a copy of the method object.
sortedRecordset 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 — 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 DeepCopy function:

    %sorted is object sortedRecordset in file geeks %sortedDCopy is object sortedRecordset in file geeks ... %sortedDCopy = %sorted:deepCopy

See also