AndRecordset (Recordset subroutine): Difference between revisions
m (1 revision) |
m (1 revision) |
||
Line 1: | Line 1: | ||
{{Template:Recordset:AndRecordset subtitle}} | |||
<var>AndRecordset</var> &ldquo;ANDs&rdquo; a <var>Recordset</var> object's records with the records in an | <var>AndRecordset</var> &amp;ldquo;ANDs&amp;rdquo; a <var>Recordset</var> object's records with the records in an | ||
existing <var>Recordset</var> object: that is, it removes records from the | existing <var>Recordset</var> object: that is, it removes records from the | ||
method <var>Recordset</var> object that are not also on the input <var>Recordset</var> object. | method <var>Recordset</var> object that are not also on the input <var>Recordset</var> object. | ||
==Syntax== | ==Syntax== | ||
{{Template:Recordset:AndRecordset syntax}} | |||
===Syntax terms=== | ===Syntax terms=== | ||
<table class="syntaxTable"> | <table class="syntaxTable"> | ||
Line 20: | Line 15: | ||
</td></tr></table> | </td></tr></table> | ||
==Usage | ==Usage notes== | ||
<ul> | <ul> | ||
<li>If the <var>Recordset</var> object argument of <var>AndRecordset</var> is null, the request is | <li>If the <var>Recordset</var> object argument of <var>AndRecordset</var> is null, the request is | ||
Line 53: | Line 48: | ||
%review:andRecordset(%bigCust) | %review:andRecordset(%bigCust) | ||
</p> | </p> | ||
==See also== | |||
{{Template:Recordset:AndRecordset footer}} |
Revision as of 23:59, 14 April 2011
Merge two Recordsets to form their logical intersection (Recordset class)
AndRecordset &ldquo;ANDs&rdquo; a Recordset object's records with the records in an
existing Recordset object: that is, it removes records from the
method Recordset object that are not also on the input Recordset object.
Syntax
recordset:AndRecordset( recordset2)
Syntax terms
%target | A non-null Recordset object variable. |
---|---|
recordsetObject | A non-null Recordset object, which must have the same file context as %target. |
Usage notes
- If the Recordset object argument of AndRecordset is null, the request is cancelled.
- Since AndRecordset never adds records to a Recordset, there are no lock strength requirements for either the method or input objects.
- The AndRecordset method can be thought of as a Recordset AND operation; AddRecordset can be thought of as an OR; and RemoveRecordset 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 find records to %review status = 'REVIEW' end find find records to %bigCust company ='TOXICO' end find %review:andRecordset(%bigCust)