Detecting absent arguments.

Feb 1, 2007 at 12:40am

Detecting absent arguments.

In an abstraction, is there a way to distinguish between an absent
argument and an argument of 0?

I would like to change the behavior of an abstraction if an argument is
omitted, but would like for 0 to remain as a valid argument.

Thanks for the help,

b


barry threw
composition : sound : programming
http://www.barrythrew.com
bthrew(at)gmail(dot)com
857-544-3967

(if you would see the stars clearly,
look hard at the surrounding darkness)
-Ooka Makoto

#30056
Feb 1, 2007 at 1:36am

I wonder if something horrible like this would do.

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P message 151 93 18 9109513 $2;
#P message 122 93 18 9109513 $1;
#P newex 202 177 66 9109513 regexp #(.*);
#P newex 244 238 26 9109513 print;
#P number 229 101 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 184 90 18 9109513 $4;
#P connect 4 0 3 0;
#P connect 5 0 3 0;
#P connect 3 3 2 0;
#P fasten 1 0 3 0 207 175;
#P connect 0 0 3 0;
#P window clipboard copycount 6;

-A

#95181
Feb 1, 2007 at 2:35am

Doesn’t seem to do anything different for me. I get a zero printed
whether I left out the argument or gave it a zero.

Did I not understand something?

b

Andrew Pask wrote:
>
> I wonder if something horrible like this would do.
>
> #P window setfont “Sans Serif” 9.;
> #P window linecount 1;
> #P message 151 93 18 9109513 $2;
> #P message 122 93 18 9109513 $1;
> #P newex 202 177 66 9109513 regexp #(.*);
> #P newex 244 238 26 9109513 print;
> #P number 229 101 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
> #P message 184 90 18 9109513 $4;
> #P connect 4 0 3 0;
> #P connect 5 0 3 0;
> #P connect 3 3 2 0;
> #P fasten 1 0 3 0 207 175;
> #P connect 0 0 3 0;
> #P window clipboard copycount 6;
>
> -A
>
>


barry threw
composition : sound : programming
http://www.barrythrew.com
bthrew(at)gmail(dot)com
857-544-3967

(if you would see the stars clearly,
look hard at the surrounding darkness)
-Ooka Makoto

#95182
Feb 1, 2007 at 3:07am

oops yeah, dumb idea, maybe I should have tried it first.

How about version 2?

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 150 149 57 9109513 patcherargs;
#P inlet 150 111 15 0;
#P newex 150 181 42 9109513 print arg;
#P connect 1 0 2 0;
#P connect 2 0 0 0;
#P window clipboard copycount 3;

-A

#95183
Feb 1, 2007 at 3:24am

Didn’t know of that object.

Solves the problem. Nice.

As always, your help is greatly appriciated. Thanks..

b

Andrew Pask wrote:
>
>
> oops yeah, dumb idea, maybe I should have tried it first.
>
> How about version 2?
>
> #P window setfont “Sans Serif” 9.;
> #P window linecount 1;
> #P newex 150 149 57 9109513 patcherargs;
> #P inlet 150 111 15 0;
> #P newex 150 181 42 9109513 print arg;
> #P connect 1 0 2 0;
> #P connect 2 0 0 0;
> #P window clipboard copycount 3;
>
>
> -A
>


barry threw
composition : sound : programming
http://www.barrythrew.com
bthrew(at)gmail(dot)com
857-544-3967

(if you would see the stars clearly,
look hard at the surrounding darkness)
-Ooka Makoto

#95184

You must be logged in to reply to this topic.