use #0 in an abstraction for tables

moze's icon

Hello,
Can we use 0 in an abstraction for tables? To me, it does not work, all the tables one them even values...
Thank you

jvkr's icon

It seems to work. As long as you make sure to make a symbol using the #0. Try this: [table #0t]
_
johan

moze's icon

thank you
i'm going to try,

moze's icon
Max Patch
Copy patch and select New From Clipboard in Max.

I do not understand it does not work,
Here are examples:

Max Patch
Copy patch and select New From Clipboard in Max.

abstraction :

Ben Bracken's icon

It appears as if you are using a #1 arg, but not giving your bpatchers any arguments. If you don't want to specify an argument and want a random one, use #0 instead of #1-#9.

-Ben

Roman Thilenius's icon

it is not enough to know that it is #0, you must also be able to remeber that when typing it. :)

moze's icon

I believe that I do not understand all the subtilitées concerning the abstractions particullary in the use of the #
With #0, it me good attribute a random number, but the contents of tables remain identical.
(sorry for bad english)

mudang's icon

smells rather buggy over here (5.1.6)...

[table #0t] from different patchers all refer to the same table. When double clicking to it's content, the window's name is always #0t !

Also, the name attribute is not working.
Try changing it in the inspector...won't do...

Emmanuel Jourdan's icon
Max Patch
Copy patch and select New From Clipboard in Max.

It works here. Be careful you seem to have 2 table objects:

mudang's icon

ahh ok, i've found the feature ;)

I always had the original patch with [table #0t] open.
So there actually was a table with the name #0t.

Funnilly, the tables inside the instances of the abstractions [table 1002-t], [table 1003-t]...all refer to [table #0t].

If I open the mother-patch, containing the abstractions, _first_ and then the original abstraction patch, this is not the case!

moze's icon

I tried the operation of mudang, despair! always the same table for 3 abstractions,
Thank you for your help!

seejayjames's icon

how about using #1t and being sure you give each abstraction an argument? that should work...

moze's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Well, I used #1 with arguments, tables are correctly named in the patch a mother, when I open them, they are not more than one

Emmanuel Jourdan's icon

Let's recap a bit...

"table #1something": the #1 part will be replaced by whatever the argument of the abstraction/bpatcher is.
"table #0something": the #0 will be replaced by an unique number (each abstraction/bpatcher instance will have a different number)

Note that in order to work properly the #n needs to be the first thing of a symbol.

Hope this clarify.

moze's icon

Thank you emmanuel, I am going to try to put on my small brain and to understand! (I hope)

seejayjames's icon

use the #1 at the beginning of the table name, and use no spaces. you had "table ifo #1" which won't work for these two reasons. for the #1 to work (in the context of things like send and receive as well) it must be at the beginning of the symbol. If you have a space in the table argument, it won't be part of the name---it would treat it as another argument. So change to "table #1ifo" or whatever you want to call it.

But there's more to it, as I discovered... I made a main patch with "table #1ifo", then made another patch with two bpatchers, so one with argument 1 and one with argument 2. Didn't work because the main table in the master patch was still open. Closed that one, still didn't work... but saved and closed the bpatch-holding patch, re-opened, then voila---the tables were correctly instantiated this time, named "1ifo" and "2ifo", with uniquely-controllable contents.

So... the main thing is to close the patches you're working with before you test with different tables. If they get created while the master one is still open, they'll always reflect that one, regardless of the arguments you give, so it seems...probably the case for coll and other objects too, not sure...

Roman Thilenius's icon

named colls behave properly with #0_ in load, the load order is not a problem
from what i can tell. with table it is a bit confusing.

moze's icon

Thank you for all these advices, I can now separate the contents of tables, this forum is really indispensable for me!
My last discovery: tables aren't saved with the patch, in the reopening, the data disappeared (I filled well "save data with patcher" in the inspector)

mudang's icon

When you want to save the table contents with the parent patcher you need to load the abstraction into a [bpatcher] and check "Embed patcher in parent".

moze's icon

That's it, everything works marvelously!!!
I thank the " guru forum ",
thanks to all
Michel