给一个例子供参考:
procedure TForm1.Button1Click(Sender: TObject);
var
s: string;
i, j: Integer;
f: array[0..1] of byte;
str: array[0..1] of string;
begin
f[0] := 1;
f[1] := 10;
with table1 do begin
open;
first;
while not eof do begin
s := '';
for i := 0 to 1 do begin
str := fields.asstring;
for j := 1 to (f - length(str) + 2) do
str := str + ' ';
s := s + str;
end;
memo1.lines.add(s);
next;
end;
end;
end;