RemoveRecord (Recordset subroutine): Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
No edit summary
 
Line 24: Line 24:


<li>If the <var>Record</var> object argument of <var>RemoveRecord</var> is null, the request is cancelled.
<li>If the <var>Record</var> object argument of <var>RemoveRecord</var> is null, the request is cancelled.
<li>Once a record has been removed from a recordset via RemoveRecord, the record data can no longer be accessed within the recordset context.
</ul>
</ul>



Latest revision as of 10:28, 10 September 2013

Remove Record object record from Recordset (Recordset class)


RemoveRecord removes the record in a Record object from the records in an existing Recordset object. It provides functionality identical to the User Language Remove Record statement, but it does so for Recordset objects.

Syntax

recordset:RemoveRecord( record)

Syntax terms

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

Usage notes

  • Since RemoveRecord never adds a record to a Recordset, there are no lock strength requirements for the method object or the input object.
  • If the Record object argument of RemoveRecord is null, the request is cancelled.
  • Once a record has been removed from a recordset via RemoveRecord, the record data can no longer be accessed within the recordset context.

Example

In the following example, records not meeting a certain criterion are removed from a Recordset:

%mailList is object recordSet in file customers find records to %mailList status = 'ACTIVE' end find for each record in %mailList if totalPurchase lt 100 then %mailList:removeRecord(currentRecord) end if end find

With version 6.8 of Sirius Mods and earlier, you must specify the class name or an object variable before the CurrentRecord method name; for example:

%mailList:removeRecord( %(Record in File customers):currentRecord )

See also