select. Selecting entries

^table.select(selection_criterion)
^table.select(selection_criterion)[options]
   [3.4.1]

The method looks through the table row by row, examining each row in respect to the specified
criterion (a mathematical expression). The rows which satisfy the criterion (returned Boolean value is "true") are collected into the table with the same structure as that of the original table.

One can specify a hash of options:

$.offset(number of rows)
Omit specified number of rows.

If a negative number is specified the rows are counted from the end of the table (-1 means the last row)   [3.4.2]
$.limit(maximum)
Maximum rows to be processed.
$.reverse(1/0)
1=in the reverse order.


Example
$men[^table::create{name   age
Stephen   26
Alex   20
Michael   29
}]
$thoseAbove20[^men.select($men.
age > 20)]

Variable
$thoseAbove20 will contain table made up of rows with Stephen and Michael.


Copyright © 1997–2017 Art. Lebedev Studio | http://www.artlebedev.com Last updated: 19.06.2012