<div dir="ltr">Aha - so the initialization of a static member of a class doesn&#39;t work at all. I see. I am a bit confused about the mixing of static variable declarations and constructor code in classes - I would think it would be more clear if the two were separated syntactically somehow. But I guess it will work this way also.<div>
<br></div><div>/Stefan<br><br><div class="gmail_quote">On Wed, Sep 10, 2008 at 5:55 PM, Kassen <span dir="ltr">&lt;<a href="mailto:signal.automatique@gmail.com">signal.automatique@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div dir="ltr">Stefan;<br><br><div class="gmail_quote"><div class="Ih2E3d"><blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex"><div dir="ltr"><br>After the first has executed daVariable = 9. After the second has executed daVariable = 8.<br>

<br>...?<br></div></blockquote></div><div><br>Well, what happens is that the second example works correctly, in the second case the variable is set to 9, after which instances are created and all of those instances set the variable to 8 at construction, hence the value is 8. In the second case the constructor doesn&#39;t work (at least not for setting the value to 9) which is the bug under debate. This means there is nothing to change the value to something else after it is set and you get a 9 (and it was a 0 before it was set to 9, not a 8).<br>

<br>When instantiating a class all code in it&#39;s body is executed so in the example that works correctly it&#39;s useless to set the variable at that spot as after that it&#39;s reset to 8 (7 times in a row, in fact).<br>

&nbsp;<br>A bit confusing, I admit.<br><br>Kas.<br></div></div><br></div>
<br>_______________________________________________<br>
chuck-users mailing list<br>
<a href="mailto:chuck-users@lists.cs.princeton.edu">chuck-users@lists.cs.princeton.edu</a><br>
<a href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users" target="_blank">https://lists.cs.princeton.edu/mailman/listinfo/chuck-users</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Release me, insect, or I will destroy the Cosmos!<br>
</div></div>