Am 13.08.2015 22:17 schrieb "Michael Van Canneyt" <mich...@freepascal.org>:
>>  if (i=0) then begin
>>    writeln ('node was empty / non existant');
>>    exit;
>>  end;
>>  for c:=0 to i do
>>      writeln (node[c]);    // line 85
>
>
> This should be
>
>   for c:=0 to i-1 do
>
>       writeln (node[c]);    // line 85

Or alternatively

for c := Low(node) to High(node) do
  Writeln(node[c]);

Or:

for n in node do // n is a var declared as String
  Writeln(n);

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

Regards,
Sven
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to