RemoveRecord (Recordset subroutine): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
m (1 revision)
Line 1: Line 1:
<span class="pageSubtitle"><section begin=dpl_desc/><section end=dpl_desc/></span>
{{Template:Recordset:RemoveRecord subtitle}}
[[Category:Recordset methods|RemoveRecord subroutine]]
<p>
<var>RemoveRecord</var> is a member of the <var>[[Recordset class|Recordset]]</var> class.
</p>


<var>RemoveRecord</var> removes the record in a <var>Record</var> object from the records
<var>RemoveRecord</var> removes the record in a <var>Record</var> object from the records
Line 10: Line 6:
<var class="product">User Language</var> <var>Remove Record</var> statement, but it does so for <var>Recordset</var> objects.
<var class="product">User Language</var> <var>Remove Record</var> statement, but it does so for <var>Recordset</var> objects.
==Syntax==
==Syntax==
<p class="syntax">%target:RemoveRecord(recordObject)
{{Template:Recordset:RemoveRecord syntax}}
</p>
===Syntax terms===
===Syntax terms===
<table class="syntaxTable">
<table class="syntaxTable">
Line 21: Line 16:


</td></tr></table>
</td></tr></table>
==Usage Notes==
==Usage notes==
<ul>
<ul>
<li>Since <var>RemoveRecord</var> never adds a record to a <var>Recordset</var>, there are no lock
<li>Since <var>RemoveRecord</var> never adds a record to a <var>Recordset</var>, there are no lock
Line 47: Line 42:
           %(Record in File customers):currentRecord)
           %(Record in File customers):currentRecord)
</p>
</p>
==See also==
{{Template:Recordset:RemoveRecord footer}}

Revision as of 23:59, 14 April 2011

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

%target A non-null Recordset object variable.
recordObject A non-null Record object, which must have the same file context as %target.

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.

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