Peter, list,
I think this program is a better example of what the problem is. It is not as artificial as the prior one, and can be executed without gdb so that one can see the problem may lie somewhere else that in debugging informations.
program loop2(input, output); var i, j : integer;
begin j:=0; repeat for i:=0 to 10 do if (i div 2)=0 then begin write('*'); j:=j+1; end; writeln; until j=10; end.
Do you agree the output should be a rectangular array of 5 stars by ten, namely, something like
****** ****** ****** ****** ****** ****** ****** ****** ****** ******
?
Well, what *I* get when running the output code is
* * * * * * * * * *
Is it the same with you? (You just cannot imagine how scared I am that *my* and only mine GPC version, poorly installed, is bugging this way).
Also, I have (in the other program) some file of text type ever opened, and I have noticed in applying your advice that GPC complains it cannot write on the default output device (the screen) because of my opened file. Just a writeln('*') and *not* a writeln(f, '*') wille make it say
?GPC runtime error: File is not open for writing (#9)
Cheers.
F.P.L