<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>