[PD] Default symbol if not set by arg
Enrique Erne
pd at mild.ch
Thu May 4 09:59:41 CEST 2006
hi chris
[list append $1]
|
[sel 0]
detects empty arguments and outputs floats _and_ symbols
regards eni
On Apr 24, 2006, at 3:49 PM, Hans-Christoph Steiner wrote:
>
> On Apr 24, 2006, at 12:51 PM, Chris McCormick wrote:
>
>> Hey All,
>>
>> When taking integer arguments in an abstraction, it's nice sometimes
>> to
>> set a default if the argument is not set. For this you can do
>> something
>> like:
>>
>> [$1]
>> |
>> [select 0]
>> | /
>> [45( /
>> | /
>> [f ]
>>
>> Or maybe something even simpler.
>>
>> I would like to do something similar for symbolic arguments. I.e. if
>> an argument is supplied, use it, otherwise use some default or take
>> some other action. Unfortunately there seems to be no way to detect an
>> 'empty' symbol. Has anyone got any ideas?
>
> You want [float_argument], [symbol_argument], and [any_argument], in
> CVS: abstractions/purepd
>
> This is how you test for a blank symbol:
>
>
> | [loadbang]
> | |
> | [symbol]
> | |
> [select symbol]
> | |
>
> .hc
>
>
>
>
>>
>> Best rgds,
>>
>> Chris.
>>
>> -------------------
>> chris at mccormick.cx
>> http://mccormick.cx
>>
>> _______________________________________________
>> PD-list at iem.at mailing list
>> UNSUBSCRIBE and account-management ->
>> http://lists.puredata.info/listinfo/pd-list
>
>
> _______________________________________________________________________
> _____
>
> "Information wants to be free."
> -Stewart Brand
>
>
> _______________________________________________
> PD-list at iem.at mailing list
> UNSUBSCRIBE and account-management ->
> http://lists.puredata.info/listinfo/pd-list
>
More information about the Pd-list
mailing list