[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
as a side note:
As many other Array-relevant methods, the documentation for these reside in
ArrayedCollection resp. SequenceableCollection
As a rule of thumb, it is a good idea to search in helpfiles of those classes if you are searching for methods you think should be implemented for Array.
:)
Till
> On 5. Jan 2019, at 16:46, marcello.lussana@xxxxxxxxxxxx wrote:
>
> On 05.01.19 15:45, jmckernon@xxxxxxxxx wrote:
>> 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);
>
> great!
> thanks!
>
>
> _______________________________________________
> 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/
_______________________________________________
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/