Answer the question
In order to leave comments, you need to log in
How, instead of the standard output of an array on the screen, display an array in a TMemo field?
Please help me rewrite the code in such a way as to get the output of the array in the TMemo field.
The code:
for i:=1 to n do begin
for j:=1 to n do write(A[i,j]:3);
writeln;
end;
for i:=1 to n do begin
for j:=1 to n do MemoMS.Text:=MemoMS.Text + IntToStr(A[i,j]:3);
MemoMS.Text:=MemoMS.Text + #13#10;
end;
Answer the question
In order to leave comments, you need to log in
var
str: string;
begin
str := '';
for i := 1 to n do begin
for j := 1 to n do begin
str := str + ' ' + IntToStr(A[i, j]);
end;
MemoMS.Lines.Add(str);
str := '';
end;
end;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question