Forums > MaxMSP

comparison operators for lists?


xaf
September 8, 2009 | 6:40 am

i’m probably overlooking something, but i just can’t find < , >, < = or >= for lists anywhere, though i thought Lobjects contains them…


September 8, 2009 | 6:52 am

Maybe a silly reply, but what do you mean by < , >, < = or >= for lists? What would generate a positive result…. if all items in one list were less than all items in another, for example?

If you’re trying to test out if a list is different to another list, you can do a number of things with [zl compare], [zl change] etc.



xaf
September 8, 2009 | 7:10 am

i want to check if each element of a list is greater or lesser then the corresponding elements of another list.

eg ’1 2 3 4′ > ’4 3 2 1′ would give ’0 0 1 1′

differences in length are not really an issue for me, as the lists will always have the same length.


September 8, 2009 | 7:14 am

The vexpr object does this.

_
johan



xaf
September 8, 2009 | 7:28 am

thanks johan


September 8, 2009 | 1:37 pm

indeed. [vexpr ($f1==$f2)] will return true or false.


Viewing 6 posts - 1 through 6 (of 6 total)