Route and select object questions
I've been looking at [route] and [select] a bit recently and noticed a few quirks, just wondered if anyone could shed some light on the reasons these oddities occur.
Route:
Multiple matches do not preserve right to left order of execution.
Select:
Floats will match a (truncated) integer argument.
Lists (beginning with a number) that do not match any arguments will only send the first element from the rightmost outlet, the reference suggests the whole list should be output.
Here are some examples. Please feel free to point it out if I'm overlooking something obvious!
lh
It looks like I've solved one of my own problems.
[select 3.] will not match "3.4" whereas [select 3] (without the decimal point) will.
lh
Quote: thereishopeforus@hotmail.com wrote on Sun, 08 February 2009 03:51
----------------------------------------------------
> It looks like I've solved one of my own problems.
>
> [select 3.] will not match "3.4" whereas [select 3] (without the decimal point) will.
----------------------------------------------------
Do you understand why this is so? Understanding int/float behavior in Max is absolutely essential to being able to work effectively.
If you've grokked it, then nobody needs to explain what you're seeing (yet again.-) But if you haven't, you need to.
Thanks Peter, but I've got this one! It was just me not realising that it was neccesary to specify that the argument was a float.
The only reason I mentioned it is that I'm trying my hand at using javascript in max to recreate the [route] object, mainly just as a lesson for myself but I had though of a few extra features that I could work in to it. I figured I should probably include all the existing features of the current object in case I wanted to drop it into an existing patch and not have unexpected side-effects crop up. The only thing causing me problems is this int vs. float as an argument thing.
I'm new to javascript and I'm fumbling my way around a bit getting to grips with things although now I kinda think I should take a step back and read up on it a bit before trying to progress.
lh