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

REBOL 3 Functions: index?

index?  series  /xy

Returns the index number of the current position in the series.

Arguments:

series [series! gob! port!]

Refinements:

/xy - Returns index as an XY pair offset

See also:

length?   offset?   head   head?   tail   tail?   pick   skip  

Description

The index function returns the position within a series. For example, the first value in a series is an index of one, the second is an index of two, etc.

str: "with all things considered"
print index? str
1
print index? find str "things"
10
blk: [264 "Rebol Dr." "Calpella" CA 95418]
print index? find blk 95418
5

Use the OFFSET? function when you need the index difference between two positions in a series.


  TOC < Back Next > REBOL.com - WIP Wiki Feedback Admin