Forums > MaxMSP

# arguments confusion

August 14, 2008 | 5:59 am

Hi,

I’m a bit stumped. I’m not sure if this is a max 5 bug or if I’m missing something about using # arguments.

say I have an subpatch [bla #1] and I save it and use it in
in a patch as [bla foo]

in [bla #1] I have [sel #11] which, when used in a patch, magically turns into [sel foo1]. This is great but for some reason when I have [send groove#1] it doesn’t turn into [send groovefoo] I still get [send groove#1]

Why is this?

Thanks in advance,

B


August 14, 2008 | 6:25 am

# arguments need to be at the beginning of a symbol.

#1_foo would work, but foo_#1 will not.

-C


August 14, 2008 | 7:57 am

Bradford Reed schrieb:
> Why is this?

because it has to be at the beginning of a symbol. For the same reason
its limited to 9 arguments. a #10 will turn into foo0 if foo is the
first argument.

If you insist in the number being at the end, you need to compose it
with sprintf. If you want more than nine arguments passed, you need to
use patcherargs… (I usually prefer patcherargs over #x, but there are
some useful exceptions…)

Stefan


Stefan Tiedje————x——-
–_____———–|————–
–(_|_ —-|—–|—–()——-
– _|_)—-|—–()————–
———-()——–www.ccmix.com


August 14, 2008 | 2:30 pm

Thanks so much for the answers.
I guess this is something I need to consider when naming variables in the future.
Best
b


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