at, _at. Element access by index   [3.4.1]

^hash._at(index|-index) 
^h
ash._at[first|last] 
^hash.at(index|-index)   [3.4.4]
^hash.at[first|last]   
[3.4.4]
^hash.at(index|-index)[key|value|hash]   
[3.4.4]
^hash.at[first|last;key|value|hash]      
[3.4.4]

The method returns element by the specified index (starting from zero), so ^hash.at(0) is equal to ^hash.at[first].
For negative index it is calculated from the end of the hash, so
^hash.at(-1) is equal to ^hash.at[last].

Optional second argument determines the result:
value - element value will be returned, by default,
key - element key will be returned,
hash - single element hash with be returned.



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