AndRecordset (Recordset subroutine)

From m204wiki
Revision as of 19:38, 7 February 2012 by Dme (talk | contribs)
Jump to navigation Jump to search

Merge two Recordsets to form their logical intersection (Recordset class)


AndRecordset "ANDs" a Recordset object's records with the records in a second Recordset object: that is, it removes records from the method Recordset object that are not also on the second Recordset object.

Syntax

recordset:AndRecordset( recordset2)

Syntax terms

recordset A non-null Recordset object variable.
recordset2 A non-null Recordset object, which must have the same file context as the method object recordset.

Usage notes

  • If the recordset2 argument 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 an exclusive OR, as shown in "RemoveRecordset 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)

See also