DeepCopy (Recordset function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
m (1 revision)
Line 1: Line 1:
<span class="pageSubtitle"><section begin=dpl_desc/><section end=dpl_desc/></span>
{{Template:Recordset:DeepCopy subtitle}}
[[Category:Recordset methods|DeepCopy function]]
<p>
<var>DeepCopy</var> is a member of the <var>[[Recordset class|Recordset]]</var> class.
</p>


<var>DeepCopy</var> is a function that returns an exact copy of the method <var>Recordset</var> object. It is identical to the <var>Recordset</var> <var>[[Copy (Recordset function)|Copy]]</var> method. <var>Recordset</var> objects are always copyable and "deep-copyable" (as these terms are described in [[Copying objects#The Object class copy methods|"The Object class copy methods"]]).
<var>DeepCopy</var> is a function that returns an exact copy of the method <var>Recordset</var> object. It is identical to the <var>Recordset</var> <var>[[Copy (Recordset function)|Copy]]</var> method. <var>Recordset</var> objects are always copyable and "deep-copyable" (as these terms are described in [[Copying objects#The Object class copy methods|"The Object class copy methods"]]).


==Syntax==
==Syntax==
<p class="syntax">%newSet = %recSet:DeepCopy([lockstrength]    -
{{Template:Recordset:DeepCopy syntax}}
                        [,&amp;nbsp;LoopLockStrength=lockstrength] )
</p>
===Syntax terms===
===Syntax terms===
<table class="syntaxTable">
<table class="syntaxTable">
Line 27: Line 21:
</td></tr></table>
</td></tr></table>


==Usage Notes==
==Usage notes==
<ul>
<ul>
<li>You can only create a copy of lock strength less than
<li>You can only create a copy of lock strength less than
Line 83: Line 77:
  CURLEY
  CURLEY
</p>
</p>
==See also==
{{Template:Recordset:DeepCopy footer}}

Revision as of 23:59, 14 April 2011

Deep copy this Recordset object (Recordset class)


DeepCopy is a function that returns an exact copy of the method Recordset object. It is identical to the Recordset Copy method. Recordset objects are always copyable and "deep-copyable" (as these terms are described in "The Object class copy methods").

Syntax

%outRecordset = recordset:DeepCopy[( [lockStrength], - [LoopLockStrength= lockStrength])]

Syntax terms

%newSet A Recordset object created by this method that contains a copy of the method object.
%recSet A Recordset object variable. The variable can be null, in which case the output object will also be null.
lockstrength A value of the LockStrength enumeration that is the lock strength to give to the instantiated Recordset object. Options are: None, Share, or Exclusive, as described in "New (Recordset constructor)". This is an optional parameter, and it defaults to the lock strength of the method object. Specifying a stronger LockStrength than the method object's lock strength is invalid and results in request cancellation.
LoopLockStrength The lock strength to be used for loops on the copied Recordset. This is an optional, name required, parameter, and it defaults to the LoopLockStrength of the method object Recordset. This parameter is only available in Sirius Mods 7.0 and later. See "LoopLockStrength for Recordsets".

Usage notes

  • You can only create a copy of lock strength less than or equal to the original, so Copy needs to acquire no locks that the user does not already hold. Therefore, Copy cannot produce a record locking conflict.
  • Specifying a lock strength greater than the lock strength of the method object is a request-cancelling error.

Example

In the following example, a base record set is created, copied, then added to:

begin %baseStooges is object recordset in file glwproc %copyStooges is object recordset in file glwproc %curleyStooge is object recordset in file glwproc fd to %baseStooges name = 'MOE' or name = 'LARRY' end find text ------ The names of the %baseStooges are: end text fr in %baseStooges text {name} end text end for %copyStooges = %baseStooges:copy fd to %curleyStooge with name = 'CURLEY' end find %copyStooges:addRecordset( %curleyStooge ) text ------ The names of the {%copyStooges:Count} %copyStooges are: end text fr in %copyStooges text {name} end text end for end

The example results follow:

------ The names of the %baseStooges are: MOE LARRY ------ The names of the 3 %copyStooges are: MOE LARRY CURLEY

See also