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.


series [series! gob! port!]


/xy - Returns index as an XY pair offset

See also:

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


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
print index? find str "things"
blk: [264 "Rebol Dr." "Calpella" CA 95418]
print index? find blk 95418

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

  TOC < Back Next > - WIP Wiki Feedback Admin