MoneyWorks Manual
CreateSelection (tableName, searchExpr, [sortExpr], [descending])
Result Type: Selection
Definition: Creates a new selection of records which can be used in a foreach loop. SortExpr can be a field name or a more complex expression. Pass 1 for the 4th parameter for a descending sort. The default (0) is ascending.
Example:
CreateSelection("transaction", "NameCode=`SPRING`", "TransDate")
Creates a selection of all transactions with a Namecode of “SPRING”, sorted by transaction date.
Note: The search expression string can also be one of the meta-search mnemonics to display the found and highlighted sets respectively.
* — the highlighted records (if any) otherwise the found set, if any, otherwise all records
*Highlight or ** — strictly the highlighted records
*Found – strictly the found set
*FoundOrAll — the found set, or all records (if the main list view for the file is not open)
*Movements — the movement detial records shown in the account enquiry
See Also:
DisplaySelection: Display standard list window for a given selection of records
IntersectSelection: Intersect a selection with the result of another search
RecordsSelected: Count records in a selection or resulting from a (meta) 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