# Index Position Operator::@

The position of value «x» in an index «i» is the integer «n» where «x» is the «n»'th element of «i». «n» is a number between 1 and Size(i). The first element of «i» is at position 1; the last element of «i» is at position Size(i). The position operator @ offers three ways to work with positions:

@i → an array of integers from 1 to Size(«i») indexed by «i».
@[i = x] → the position of value «x» in index «i» -- or 0 if «x» is not an element of «i»
e[@i = n] → the «n»'th Slice of the value of expression «e» over index «i».

These turn out to make many array operations much simpler than prior to release 4.0.

## Examples

We'll use the following indexes for illustration:

Index Car_type := ['VW', 'Honda', 'BMW']
Index Time := [0, 1, 2, 3, 4]
Index Years := Time + 2007
@CarType →
Car_Type ▶
'VW' 'Honda' 'BMW'
1 2 3
@[Car_type = 'Honda'] → 2
Car_type[@Car_type = 2] → 'Honda'
@Time →
Time ▶
0 1 2 3 4
1 2 3 4 5
@[Time = 2] → 3
Time[@Time = 3] → 2
(Time + 2007)[@Time = 3] → 2009

You can use the slice variation to re-index an array by another array having the same length but different elements. Suppose Revenue is indexed by Time, then this returns the same array indexed by Years:

Revenue[Time = @Years]