<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
Hey'all!<br>I've been trying to understand how to share one objects variables with others, i.e. to have a storaging object that others can access (it's possible, right?), like [value] does, so that the first object would hold the data globally like an array, and the other one(s) could have pointers to its variables and thus change the values directly. So what I need is a way to deliver pointer of one objects data to the other. I can't get the other, reading, object to read the value correctly. I haven't been able to find much documentation concerning pd_findbyclass and how the symbol system actually works under the hood, so if anyone could kindly point me towards any or explain what I'm missing here:<br><br>STORAGING OBJECT:<br><br>#include "m_pd.h"<br><br>static t_class *aset_class;<br><br>typedef struct _aset {<br>&nbsp;&nbsp;&nbsp; t_object&nbsp; x_obj;<br>&nbsp;&nbsp;&nbsp; t_pd&nbsp;&nbsp;&nbsp; x_pd;<br>&nbsp;&nbsp;&nbsp; t_int&nbsp;&nbsp; x_i;<br>} t_aset;<br><br>void *aset_new(t_symbol *s) <br>{<br>&nbsp;&nbsp;&nbsp; t_aset *x = (t_aset *)pd_new(aset_class);<br>&nbsp;&nbsp;&nbsp; x-&gt;x_i = 34; <br>&nbsp;&nbsp;&nbsp; pd_bind(&amp;x-&gt;x_pd, s); <br>&nbsp;&nbsp;&nbsp; post("control %i", x-&gt;x_i);<br>&nbsp;&nbsp;&nbsp; return (x);<br>}<br><br>void aset_setup(void) {<br>&nbsp;&nbsp;&nbsp; aset_class = class_new(gensym("aset"), <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (t_newmethod)aset_new,&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0, sizeof(t_aset),<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CLASS_DEFAULT,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A_SYMBOL, 0);<br>}<br><br>----------------------------------<br>READING OBJECT:<br>----------------------------------<br><br>#include "m_pd.h"<br>#include "aset.c"<br><br>static t_class *aget_class;<br><br>typedef struct _aget {<br>&nbsp;&nbsp;&nbsp; t_object&nbsp; x_obj;<br>&nbsp;&nbsp;&nbsp; t_pd x_pd;<br>} t_aget;<br><br>void *aget_new(t_symbol *s) <br>{<br>&nbsp;&nbsp;&nbsp; t_aget *x = (t_aget *)pd_new(aget_class);<br>&nbsp;&nbsp;&nbsp; t_aset *c = (t_aset *)pd_findbyclass(s, aset_class);<br><br>&nbsp;&nbsp;&nbsp; post("read %i", c-&gt;x_i);<br><br>&nbsp;&nbsp;&nbsp; return (x);<br>}<br><br>void aget_setup(void) {<br>&nbsp; aget_class = class_new(gensym("aget"), <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (t_newmethod)aget_new,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0, sizeof(t_aget),<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CLASS_DEFAULT,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A_SYMBOL, 0); <br>}<br><br><br>Cheers!<br>Olli<br>                                               </body>
</html>