Forums > MaxMSP

Check if an index exists in a coll, without doing a dump?

March 5, 2008 | 10:21 pm

Hello,

Is it possible to get any sort of bang or message for "not here, buddy"… If I send an index to a coll and it doesn’t exist, I get no feedback.

I realize I can dump the whole coll and check every entry, but that’s slow. Searching through coll I’m not seeing anything that simply lets you check on an index…

- Glot


March 5, 2008 | 10:47 pm

On 5 mars 08, at 23:21, Glot wrote:

> Is it possible to get any sort of bang or message for "not here,
> buddy"… If I send an index to a coll and it doesn’t exist, I get
> no feedback.
>
> I realize I can dump the whole coll and check every entry, but
> that’s slow. Searching through coll I’m not seeing anything that
> simply lets you check on an index…

The solution bellow demonstrates how to achieve that using something
which store a "flag".

HTH,
ej

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P comment 158 208 75 196617 store anything;
#P comment 230 159 143 196617 remove the symbol keyword;
#P newex 392 144 72 196617 prepend store;
#P newex 392 123 44 196617 zl rot 1;
#P newex 146 156 69 196617 route symbol;
#P toggle 80 285 15 0;
#P newex 172 255 21 196617 t 1;
#P newex 80 255 21 196617 t 0;
#P newex 80 233 102 196617 route AreYouThere?;
#P message 121 61 26 196617 tata;
#P message 80 61 26 196617 toto;
#P newex 80 206 76 196617 zl reg;
#N coll yourColl 1;
#P newobj 124 132 76 196617 coll yourColl 1;
#B color 14;
#P newex 80 97 98 196617 t b s AreYouThere?;
#P newex 392 102 52 196617 listfunnel;
#P newex 392 81 110 196617 loadmess toto titi tutu;
#B color 4;
#N coll yourColl 1;
#P newobj 392 165 76 196617 coll yourColl 1;
#B color 14;
#P comment 413 58 59 196617 fill the coll;
#P comment 83 37 143 196617 check if the item is in the coll;
#P connect 15 0 16 0;
#P connect 16 0 2 0;
#P connect 4 0 15 0;
#P connect 6 1 14 0;
#P fasten 5 2 7 1 173 123 228 123 228 192;
#P connect 14 1 7 1;
#P connect 14 0 7 1;
#P connect 7 0 10 0;
#P connect 11 0 13 0;
#P connect 12 0 13 0;
#P connect 10 0 11 0;
#P connect 10 1 12 0;
#P connect 9 0 5 0;
#P connect 8 0 5 0;
#P connect 5 0 7 0;
#P connect 5 1 6 0;
#P connect 3 0 4 0;
#P window clipboard copycount 19;


March 5, 2008 | 11:12 pm


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