<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html><body>
<div>Hello,</div>
<div>I don’t understand why at the second reading of a Structure array I always get the value of the last element.</div>
<div>
<pre><code class="hljs php"><span class="hljs-keyword">Public</span> Struct AAAA<br /> b <span class="hljs-keyword">As</span> Byte<br /> c <span class="hljs-keyword">As</span> Short<br /> i <span class="hljs-keyword">As</span> Integer<br />End Struct<br /><br /><br />Public Sub Main()<br /><br /> Dim a <span class="hljs-keyword">As</span> <span class="hljs-keyword">New</span> AAAA<br /> Dim aa <span class="hljs-keyword">As</span> <span class="hljs-keyword">New</span> AAAA[]<br /> Dim i <span class="hljs-keyword">As</span> Integer<br /> <br /> <span class="hljs-keyword">For</span> i = <span class="hljs-number">0</span> To <span class="hljs-number">7</span><br /> aa.Push(a)<br /> Valorizza(i, aa[i])<br /> <span class="hljs-keyword">Print</span> aa[i].b, <span class="hljs-string"> ' first</span><br /><span class="hljs-string"> Next</span><br /><br /><span class="hljs-string">Print</span><br /><span class="hljs-string">Print</span><br /><br /><span class="hljs-string"> For i = 0 To 7</span><br /><span class="hljs-string"> Print aa[i].b, '</span> second<br /> Next<br /><br />End<br /><br /><br />Private Procedure Valorizza(c <span class="hljs-keyword">As</span> Integer, s <span class="hljs-keyword">As</span> AAAA)<br /> <br /> s.b = <span class="hljs-number">4</span> * c<br /> <br />End</code></pre>
</div>
</body></html>
<br><br/><br/>Con OpenStar hai Giga, SMS e i minuti che vuoi da 4,99€ al mese, per sempre. Cambi gratis quando e come vuoi e in più hai 6 mesi di INFINTY! <a href='http://tisca.li/myopen' target='_blank'>http://tisca.li/myopen</a><br/><br/>