<p>Am 13.08.2015 22:17 schrieb "Michael Van Canneyt" <<a href="mailto:michael@freepascal.org">michael@freepascal.org</a>>:<br>
>> Â if (i=0) then begin<br>
>> Â Â writeln ('node was empty / non existant');<br>
>> Â Â exit;<br>
>> Â end;<br>
>> Â for c:=0 to i do<br>
>> Â Â Â writeln (node[c]);Â Â // line 85<br>
><br>
><br>
> This should be<br>
><br>
> Â for c:=0 to i-1 do<br>
><br>
> Â Â Â writeln (node[c]);Â Â // line 85</p>
<p>Or alternatively</p>
<p>for c := Low(node) to High(node) do<br>
 Writeln(node[c]);</p>
<p>Or:</p>
<p>for n in node do // n is a var declared as String<br>
 Writeln(n);</p>
<p>Note: you can't modify array elements in the for-in-statement, as the iterator variable merely contains a copy; however if the iterator variable is a pointer type (or class/interface instance) then you can modify the element's contents of course, but not the element itself (e.g. changing the pointer value).</p>
<p>Regards,<br>
Sven</p>