[fpc-pascal] EAccessViolation

Michael Van Canneyt michael at freepascal.org
Thu Aug 13 22:17:08 CEST 2015



On Thu, 13 Aug 2015, Chris Moody wrote:

> Hi all,
>
> I have this procedure in my program:
>
> procedure DisplayNode (var node:astring);
> var c, i:integer;
> begin
>  i:=SizeOf(node);

This should be length(node)

>  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

Michael.



More information about the fpc-pascal mailing list