Edit

RecordsSelected (selection)

Result Type: Number

Definition: Returns the number of records found in named selection.

Examples:  RecordsSelected(tSel)

returns the number of records in the selection tSel, which would have previously been created using the createSelection or intersectSelection function, as in the following:

tSel = createSelection("Transaction", "type = 'DII' and status='P'")

which creates a selection of the outstanding (posted) sales invoices.

Variant of RecordsSelected that duplicates the functionality of the variant of Find()

RecordsSelected (file, metaSearch)

Result Type: Number

Definition: Returns the number of records found in the file that match metaSearch (see metasearch mnemonics). MetaSearch is one of “*” or “**”, whose function is explained in the two examples below. See also the first form of Find().

Examples:  RecordsSelected("Transaction", "**")

returns the number of highlighted transactions (or 0 if none are highlighted).

RecordsSelected("Name", "*")

returns the number of highlighted records in the Names file, or, if none are highlighted, the number of name records in the found set, or, if the names list window is not open, the total number of name records in the file.

This is exactly the same behaviour as Find(filename, search) — a case of convergent evolution where two functions have expanded their functionality until they end up doing the same thing.

See Also:

CreateSelection: Create a selection of records

DisplaySelection: Display standard list window for a given selection of records

IntersectSelection: Intersect a selection with the result of another search

SumDetail: Add up a field for details matching a search

SumSelection: Add up a field for records matching a search

UnionSelection: Add the result of another search to a selection