On Mon, 20 Dec 2004 [EMAIL PROTECTED] wrote: > On Mon, 20 Dec 2004, Dariusz Mazur wrote: > > > I have problem with two dimension array of string > > > > my program: > > > > procedure testlinie; > > var > > linie : array[0..1,0..100] of shortstring; > > i,ii : integer; > > begin > > fillchar(linie,sizeof(linie),0); > > for i := 0 to 1 do begin > > for ii:= 1 to 10 do begin > > linie[i,ii]:= linie[i,ii]+char(64+ii); > > writeln(i:5,ii:5,linie[i,ii]) ; > > > > end; > > end; > > end; > > > > during execution output is: > > 0 1 A > > 0 2 B > > 0 3 C etc. > > > > but should be: > > 0 1 A > > 0 2 AB > > 0 3 ABC > > > > on Delphi all works OK. > > I seriously doubt this:
Me either, but it seems that there is a simple typo in the inner loop (ii instead of ii-1), so it should go like that: for ii:= 1 to 10 do begin linie[i,ii]:= linie[i,ii-1]+char(64+ii); writeln(i:5,ii:5,linie[i,ii]) ; end; Best, Adam _______________________________________________ fpc-pascal maillist - [EMAIL PROTECTED] http://lists.freepascal.org/mailman/listinfo/fpc-pascal