RemoveRecordset (Recordset subroutine): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
m (1 revision)
Line 1: Line 1:
{{Template:Recordset:RemoveRecordset subtitle}}


<span class="pageSubtitle"><section begin=dpl_desc/><section end=dpl_desc/></span>
<var>RemoveRecordset</var> &amp;amp;ldquo;NOTs&amp;amp;rdquo; a <var>Recordset</var> object's records with the records
[[Category:Recordset methods|RemoveRecordset subroutine]]
<p>
<var>RemoveRecordset</var> is a member of the <var>[[Recordset class|Recordset]]</var> class.
</p>
 
<var>RemoveRecordset</var> &amp;ldquo;NOTs&amp;rdquo; a <var>Recordset</var> object's records with the records
in an existing
in an existing
<var>Recordset</var> object: that is, it removes records from the method <var>Recordset</var> object
<var>Recordset</var> object: that is, it removes records from the method <var>Recordset</var> object
that are in the input <var>Recordset</var> object.
that are in the input <var>Recordset</var> object.
==Syntax==
==Syntax==
<p class="syntax">%target:RemoveRecordset(recordsetObject)
{{Template:Recordset:RemoveRecordset syntax}}
</p>
===Syntax terms===
===Syntax terms===
<table class="syntaxTable">
<table class="syntaxTable">
Line 22: Line 16:


</td></tr></table>
</td></tr></table>
==Usage Notes==
==Usage notes==
<ul>
<ul>
<li>If the <var>Recordset</var> object argument of <var>RemoveRecordset</var> is null, the request is
<li>If the <var>Recordset</var> object argument of <var>RemoveRecordset</var> is null, the request is
Line 67: Line 61:
and <code>%second</code>.
and <code>%second</code>.
</ul>
</ul>
==See also==
{{Template:Recordset:RemoveRecordset footer}}

Revision as of 23:59, 14 April 2011

Remove from a Recordset the records that are matched in input Recordset (Recordset class)


RemoveRecordset &amp;ldquo;NOTs&amp;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 in the input Recordset object.

Syntax

recordset:RemoveRecordset( 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 RemoveRecordset is null, the request is cancelled.
  • Since RemoveRecordset never adds records to a Recordset, there are no lock strength requirements for the method object or the input object.

Examples

  • In the following example, the result of one Find is used to eliminate records from the result of another Find.

    %threaten is object recordSet in file orders %bigCust is object recordSet in file orders find records to %threaten status = 'ARREARS' end find find records to %bigCust company ='TOXICO' end find %threaten:removeRecordset(%bigCust)

  • RemoveRecordset can be thought of as a NOT operation, AddRecordset as an OR, and AndRecordset as an AND. The missing basic logical operation is an exclusive OR, which is not implemented as a basic method because it is expected to be rarely needed. However, you can achieve such an exclusive OR operation with the provided methods, as in the following example:

    %first is object recordSet in foo %second is object recordSet in foo %both is object recordSet in foo ... %both = %first:copy %both:andRecordset(%second) %first:addRecordset(%second) %first:removeRecordset(%both)

    And %first is now the exclusive OR of the original %first and %second.

See also