Extract - Function SummarySummary:Extracts a value from a series at regular intervals. Usage:extract block width Arguments:block - The block argument. (must be: block hash) width - Size of each entry (the skip) (must be: integer) Refinements:/index - Extract from an offset position pos - The position Description:Returns a new block that contains values that are spaced at regular intervals throughout a specified block. This is useful if you have a block that contains implicit "rows" or "records" of data. The WIDTH is the size of each row. In the example below, the width of each row is three:
You can see that by default, EXTRACT works on the first element of each row. To extract a different "column" of the data, use the /INDEX refinement to specify an offset position:
Of course, extract works on any block series, not just those that appear in a row format (such as that above). The example below creates a block containing every other word from a string:
Here is an example that uses EXTRACT to obtain the names of all the predefined REBOL/View VID styles:
| ||||||
|