RemoveRecordsetNew (Recordset function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
Line 47: Line 47:
  %threaten = %arrears:removeRecordset(%bigCust)
  %threaten = %arrears:removeRecordset(%bigCust)
</p>
</p>
<li><var>RemoveRecordsetNew</var> can be thought of as a NOT operation,
<li><var>RemoveRecordsetNew</var> can be thought of as subtraction,
<var>[[AddRecordsetNew (Recordset function)|AddRecordsetNew]]</var> as an
<var>[[AddRecordsetNew (Recordset function)|AddRecordsetNew]]</var> as an
OR, and <var>[[AndRecordsetNew (Recordset function)|AndRecordsetNew]]</var> as an AND.
OR, and <var>[[AndRecordsetNew (Recordset function)|AndRecordsetNew]]</var> as an AND.
Line 66: Line 66:
and <code>%second</code>.
and <code>%second</code>.
</ul>
</ul>
==See also==
==See also==
{{Template:Recordset:RemoveRecordsetNew footer}}
{{Template:Recordset:RemoveRecordsetNew footer}}

Revision as of 19:41, 7 February 2012

Create Recordset from all records in one Recordset that are not in another (Recordset class)


RemoveRecordsetNew &amp;ldquo;NOTs&amp;rdquo; a Recordset object's records with the records in an existing Recordset object and produces a new Recordset object that contains all the records in the first Recordset, but not the second. That is, it removes records from the method Recordset object that are in the input Recordset object.

Syntax

%outRecordset = recordset:RemoveRecordsetNew( 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 and %rs.

Usage notes

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

Examples

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

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

  • RemoveRecordsetNew can be thought of as subtraction, AddRecordsetNew as an OR, and AndRecordsetNew 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 %xor is object recordSet in foo ... %xor = %first:addRecordsetNew(%second): - removeRecordset(%first:andRecordsetNew(%second))

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

See also