index of the higher number in a list?

Kasper's icon

hi

I feel I almost have it, but not quite........ something is missing (maybe coffe??) :

given a list of 4 ints (a b c d), I want to know the index (position) of the higher/greatest of them
(if it is, say (8 4 5 7) it would be 1, if ( 8 12 6 9), 2 etc)

If 2 of them are equal, i will choose one (in some way, might be the first in list, whatever - let's suppose they can not be equal.....)

any help?

many thanks

kasper

Chris Muir's icon

Ltop from the Lobjects just does this.

pid's icon
Max Patch
Copy patch and select New From Clipboard in Max.

[zl sort] is your very simple friend:

Kasper's icon

many thanks to both - I was looking into ZL and Lobjects, but obviousely lacked coffee!!!!!!

k

Christopher Dobrian's icon
Max Patch
Copy patch and select New From Clipboard in Max.

encore plus simple ... maximum

Chris Muir's icon

Right. I forgot maximum can deal with lists.

o s's icon
Max Patch
Copy patch and select New From Clipboard in Max.

can also be done with coll/max, a bit cumbersome though

Kasper's icon

!!!!!!!!!!!!!!!!!!!!!

thanks all

!!!!!!!!!!!!!!!!!!!!!!

k