Hi Benoit,<div><br></div><div>I have created a minimalist class with two properties. I expected that the properties would be created on a per-instance bases. However, what i got was something similar to static properties.</div>

<div>When I create two instances of the class setting a property in one instance, sets it in the other.  So I know I missed something here...</div><div><br></div><div>I have sample code and output below.</div><div><br></div>

<div>P.S. Currently I am including the c source file in my main file to force compiling the code. So I still need to figure out how to add a source file to the make process.</div><div><br></div><div><br></div><div>Thanks again!</div>

<div><br></div><div>Randy</div><div><br></div><div><br></div><div><br></div><div>' In Gambas</div><div>Dim q As Complex</div><div>Dim v As Complex = New Complex</div><div><br></div><div>q = New Complex</div><div><br>
</div>
<div>q.Real = 10</div><div>q.Imag = 5</div><div><br></div><div>v.Real = 12</div><div>v.Imag = 6</div><div><br></div><div>Print q.Real</div><div>Print q.Imag</div><div><br></div><div>Print v.Real</div><div>Print v.Imag</div>

<div><br></div><div>Print q</div><div>Print v</div><div>-----------------------------------------------------</div><div> Output</div><div>-----------------------------------------------------</div><div>12</div><div>6</div>

<div>12</div><div>6</div><div><div>(Complex 0x8b5865c)</div><div>(Complex 0x8bad4fc)</div></div><div><br></div><div><div><br></div><div><br></div><div>' In Class file</div><div>#ifndef __C_GSL_COMPLEX_C</div><div>#define __C_GSL_COMPLEX_C</div>

<div><br></div><div>#include "c_complex.h"</div><div>#include "gambas.h"</div><div>#include "gb_common.h"</div><div>#include "c_gsl.h"</div><div>#include <gsl/gsl_math.h></div>

<div>#include <gsl/gsl_complex.h></div><div>#include <gsl/gsl_sf.h></div><div><br></div><div>#endif</div><div><br></div><div>// Class Properties</div><div>double real;</div><div>double imagined;</div><div><br>

</div><div>BEGIN_PROPERTY(GSLCOMPLEX_REAL)</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">   </span>if (READ_PROPERTY)</div><div><span class="Apple-tab-span" style="white-space:pre">           </span>GB.ReturnFloat(real);</div>

<div><span class="Apple-tab-span" style="white-space:pre">      </span>else</div><div><span class="Apple-tab-span" style="white-space:pre">         </span>real = (VPROP(GB_FLOAT));</div><div><br></div><div>END_PROPERTY</div><div><br>

</div><div><br></div><div>BEGIN_PROPERTY(GSLCOMPLEX_IMAGINED)</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">      </span>if (READ_PROPERTY)</div><div><span class="Apple-tab-span" style="white-space:pre">           </span>GB.ReturnFloat(imagined);</div>

<div><span class="Apple-tab-span" style="white-space:pre">      </span>else</div><div><span class="Apple-tab-span" style="white-space:pre">         </span>imagined = (VPROP(GB_FLOAT));</div><div><br></div><div>END_PROPERTY</div><div>

<br></div><div><br></div><div>/**************************************************</div><div>  Describe Class properties and methods to Gambas</div><div>**************************************************/</div><div>GB_DESC CGslComplexDesc[] =</div>

<div>{</div><div>    GB_DECLARE("Complex", sizeof(CCOMPLEX)),</div><div><br></div><div>    GB_PROPERTY("Real", "f", GSLCOMPLEX_REAL),</div><div>    GB_PROPERTY("Imag", "f", GSLCOMPLEX_IMAGINED),</div>

<div><br></div><div>    GB_END_DECLARE</div><div>};</div></div><div><br></div><div><br></div><div><br clear="all"><div><br></div>-- <br>If you ask me if it can be done. The answer is YES, it can always be done. The correct questions however are... What will it cost, and how long will it take?<br>


</div>