hi, I want to create an abstraction that can take an optional symbol as argument. if there is a symbol argument then use this, if not then use a default symbol.
for example [my_print hello_world!] would print "hello_world!"
[my_print] (without argument) would print "default_text"
[my_print 0] or [my_print 123] would also print "default_text".
I tried all variations of route, select, list trim, but could not get it to work. maybe I forgot something. or maybe there is another trick. I am using 0.40. marius.
here's a dirty one, but works.
hi, I want to create an abstraction that can take an optional symbol as argument. if there is a symbol argument then use this, if not then use a default symbol.
for example [my_print hello_world!] would print "hello_world!"
[my_print] (without argument) would print "default_text"
[my_print 0] or [my_print 123] would also print "default_text".
I tried all variations of route, select, list trim, but could not get it to work. maybe I forgot something. or maybe there is another trick. I am using 0.40. marius.
PD-list@iem.at mailing list UNSUBSCRIBE and account-management ->
http://lists.puredata.info/listinfo/pd-list
great! the [sel $1] did the trick. otoh, the route symbol does not do anything... here is what I ended up using...
[loadbang] | [symbol $1] | [sel $1] | | | [default_symbol( / | / |/ [symbol $1] | [print]
thanks, marius.
João Miguel Pais wrote:
here's a dirty one, but works.
hi, I want to create an abstraction that can take an optional symbol as argument. if there is a symbol argument then use this, if not then use a default symbol.
for example [my_print hello_world!] would print "hello_world!"
[my_print] (without argument) would print "default_text"
[my_print 0] or [my_print 123] would also print "default_text".
I tried all variations of route, select, list trim, but could not get it to work. maybe I forgot something. or maybe there is another trick. I am using 0.40. marius.
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
ah, I thought you want to print "defaul_symbol" and not "symbol
default_symbol", that's why all the extra stuff around.
great! the [sel $1] did the trick. otoh, the route symbol does not do
anything... here is what I ended up using...[loadbang] | [symbol $1] | [sel $1] | | | [default_symbol( / | / |/ [symbol $1] | [print]
thanks, marius.
João Miguel Pais wrote:
here's a dirty one, but works.
hi, I want to create an abstraction that can take an optional symbol as argument. if there is a symbol argument then use this, if not then use a default symbol.
for example [my_print hello_world!] would print "hello_world!"
[my_print] (without argument) would print "default_text"
[my_print 0] or [my_print 123] would also print "default_text".
I tried all variations of route, select, list trim, but could not get
it to work. maybe I forgot something. or maybe there is another trick. I
am using 0.40. marius.
PD-list@iem.at mailing list UNSUBSCRIBE and account-management ->
http://lists.puredata.info/listinfo/pd-list