REBOL 3 Docs Guide Concepts Functions Datatypes Errors
  TOC < Back Next >   Updated: 3-Aug-2010 Edit History  

REBOL 3 Functions: pick

pick  series  index

Returns the value at the specified position in a series.


series [series! map! gob! pair! date! time! tuple! bitset! port!]

index - Index offset, symbol, or other value to use as index

See also:

first   second   third   fourth   fifth   find   select  


The value is picked relative to the current position in the series (not necessarily the head of the series). The VALUE argument may be INTEGER or LOGIC. A positive integer positions forward, a negative positions backward. If the INTEGER is out of range, NONE is returned. If the value is LOGIC, then TRUE refers to the first position and FALSE to the second (same order as EITHER). An attempt to pick a value beyond the limits of the series will return NONE.

str: "REBOL"

print pick str 2
print pick 3
print pick ["this" "that"] now/time > 12:00

  TOC < Back Next > - WIP Wiki Feedback Admin