PDA

View Full Version : List of objects


kornalius
10-13-2006, 02:55 PM
It is possible to store objects in linked-list offering a wide range of possibilities to your applications.</p><pre><span style=&quot;color: #0066ff&quot;>#class myclass
* public (z$);
* private (x$);</span></pre><pre><span style=&quot;color: #0066ff&quot;>* nproc create
*** x$ = args$[0];
* end;</span></pre><pre><span style=&quot;color: #0066ff&quot;>* func getx
*** return(x$);
* end;
*
* proc m
*** ShowMessage(x$ + &quot;,&quot; + z$);
* end;</span></pre><pre></pre><pre><span style=&quot;color: #0066ff&quot;>proc main
* Local(l$, i$);</span></pre><pre></pre><pre><span style=&quot;color: #0066ff&quot;>* for(i$, 1, 5)
*** Add(l$);
*** #object myclass l$(i$);
* end;</span></pre><pre><span style=&quot;color: #0066ff&quot;>* foreach(l$)
*** l.z$ = l.getx * 2;
*** l.m;
* end;
end;</span></pre>

Just imagine the possibilities... Linked-lists are very powerful.</p>

Solonn
10-28-2006, 08:40 AM
Damn... I'll have to rewrite half of my program now... ;)