# arguments confusion

Aug 14, 2008 at 5:59am

# arguments confusion

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

#39270
Aug 14, 2008 at 6:25am

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

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

-C

#137980
Aug 14, 2008 at 7:57am

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

#137981
Aug 14, 2008 at 2:30pm

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

#137982

You must be logged in to reply to this topic.