AndRecordsetNew (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:AndRecordsetNew subtitle}}
[[Category:Recordset methods|AndRecordsetNew function]]
<p>
<var>AndRecordsetNew</var> is a member of the <var>[[Recordset class|Recordset]]</var> class.
</p>


<var>AndRecordsetNew</var> &amp;ldquo;ANDs&amp;rdquo; a <var>Recordset</var> object's records with the records in an
<var>AndRecordsetNew</var> &amp;amp;ldquo;ANDs&amp;amp;rdquo; a <var>Recordset</var> object's records with the records in an
another <var>Recordset</var> object and produces a new <var>Recordset</var> object that contains the
another <var>Recordset</var> object and produces a new <var>Recordset</var> object that contains the
records in both <var>Recordsets</var>.
records in both <var>Recordsets</var>.
It does the same processing as <var>[[AndRecordset (Recordset subroutine)|AndRecordset]]</var>,
It does the same processing as <var>[[AndRecordset (Recordset subroutine)|AndRecordset]]</var>,
but it produces a new output <var>Recordset</var> and leaves the two input <var>Recordsets</var> unmodified.
but it produces a new output <var>Recordset</var> and leaves the two input <var>Recordsets</var> unmodified.
==AndRecordset syntax==
==Syntax==
<p class="pre"> %target = %rs:AndRecordset(recordsetObject)
{{Template:Recordset:AndRecordsetNew syntax}}
</p>
===Syntax terms===
===Syntax terms===
<table class="syntaxTable">
<table class="syntaxTable">
Line 25: Line 20:


</td></tr></table>
</td></tr></table>
==Usage Notes==
==Usage notes==
<ul>
<ul>
<li>The <var>AndRecordsetNew</var> method is only available in <var class="product">Sirius Mods</var> 7.1 and later.
<li>The <var>AndRecordsetNew</var> method is only available in <var class="product">Sirius Mods</var> 7.1 and later.
Line 63: Line 58:
  %bigReview = %review:andRecordsetNew(%bigCust)
  %bigReview = %review:andRecordsetNew(%bigCust)
</p>
</p>
==See also==
{{Template:Recordset:AndRecordsetNew footer}}

Revision as of 23:59, 14 April 2011

Create new Recordset from intersection of two Recordsets (Recordset class)


AndRecordsetNew &amp;ldquo;ANDs&amp;rdquo; a Recordset object's records with the records in an another Recordset object and produces a new Recordset object that contains the records in both Recordsets. It does the same processing as AndRecordset, but it produces a new output Recordset and leaves the two input Recordsets unmodified.

Syntax

%outRecordset = recordset:AndRecordsetNew( recordset2)

Syntax terms

%target The Recordset object variable created by this method.
%rs A non-null Recordset object, which must have the same file context as %target.
recordsetObject A non-null Recordset object, which must have the same file context as %target.

Usage notes

  • The AndRecordsetNew method is only available in Sirius Mods 7.1 and later.
  • The LockStrength and LoopLockStrength of the output Recordset object is the same as that of the method object (%rs).
  • If the Recordset object argument of AndRecordsetNew is null, the request is cancelled.
  • Since AndRecordsetNew never adds records to a Recordset, there are no lock strength requirements for either the method or input object.
  • The AndRecordsetNew method can be thought of as a Recordset AND operation; AddRecordsetNew can be thought of as an OR; and RemoveRecordsetNew as a NOT. No basic method is the analog of an exclusive OR operation, but you can use the basic methods to achieve such an OR, as shown in "Examples".

Example

In the following example, the result of one Find is used to limit the result of another Find. Of course, identical processing could be better done with an And in a Find statement.

%review is object recordSet in file orders %bigCust is object recordSet in file orders %bigReview is object recordSet in file orders find records to %review status = 'REVIEW' end find find records to %bigCust company ='TOXICO' end find %bigReview = %review:andRecordsetNew(%bigCust)

See also