<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> t_object x_obj;<br> t_pd x_pd;<br> t_int x_i;<br>} t_aset;<br><br>void *aset_new(t_symbol *s) <br>{<br> t_aset *x = (t_aset *)pd_new(aset_class);<br> x->x_i = 34; <br> pd_bind(&x->x_pd, s); <br> post("control %i", x->x_i);<br> return (x);<br>}<br><br>void aset_setup(void) {<br> aset_class = class_new(gensym("aset"), <br> (t_newmethod)aset_new, <br> 0, sizeof(t_aset),<br> CLASS_DEFAULT,<br> 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> t_object x_obj;<br> t_pd x_pd;<br>} t_aget;<br><br>void *aget_new(t_symbol *s) <br>{<br> t_aget *x = (t_aget *)pd_new(aget_class);<br> t_aset *c = (t_aset *)pd_findbyclass(s, aset_class);<br><br> post("read %i", c->x_i);<br><br> return (x);<br>}<br><br>void aget_setup(void) {<br> aget_class = class_new(gensym("aget"), <br> (t_newmethod)aget_new,<br> 0, sizeof(t_aget),<br> CLASS_DEFAULT,<br> A_SYMBOL, 0); <br>}<br><br><br>Cheers!<br>Olli<br>                                            </body>
</html>