# find a value in an array

Get help using Construct 2

### » Wed Dec 18, 2013 6:11 pm

hi,

i have a little problem to find a value in an array.

I have this Array :

[code]{"c2array":true,"size":[2,21,1],"data":[[[-50],[-47.5],[-45],[-42.5],[-40],[-37.5],[-35],[-32.5],[-30],[-27.5],[-25],[-22.5],[-20],[-17.5],[-15],[-12.5],[-10],[-7.5],[-5],[-2.5],[0]],[[0],[5],[10],[15],[20],[25],[30],[35],[40],[45],[50],[55],[60],[65],[70],[75],[80],[85],[90],[95],[100]]]}[/code]

i know only the Value of Y in X0

X0, Y = -17.5
X1, Y = 65

but i have a value of -17.5 , how to find the attached value in X where i know only -17.5 ?

Is it possible to have this value ?

B
38
S
13
G
4
Posts: 152
Reputation: 5,147

### » Wed Dec 18, 2013 7:14 pm

You mean something like:

array current value = -17.5
set text : array.at(array.curx+1,array.cury)
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

### » Wed Dec 18, 2013 7:34 pm

@LittleStain, thanks you very much, works perfectly with your exemple
B
38
S
13
G
4
Posts: 152
Reputation: 5,147