[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [sc-users] Array: how to get the the index position of a certain value
On 1/5/19, marcello.lussana@xxxxxxxxxxxx <marcello.lussana@xxxxxxxxxxxx> wrote:
> hi,
>
> how can retrieve the index position of a value in an array?
>
> something like:
> a = [1.2, 2.3, 3.4]
> // I would like to know the position of the value 2.3, like
> a.indexPosition(2.3) // i made up the name of this method
> => 1
You were very close.
a.indexOf(2.3);
_______________________________________________
sc-users mailing list
info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/