16,742
社区成员
发帖
与我相关
我的任务
分享
const
iMax = 20;
var
s: WideString;
i, iLeng: Integer;
begin
s := edt1.Text;
iLeng := Length(s);
Button1.Caption := inttostr(iLeng);
for i := 1 to iMax - iLeng do
s := s + #32#32;
for i := 1 to iLeng do
if ord(s[i]) < 183 then
s := s + #32;
mmo1.Font.Name := '新宋体';
mmo1.Font.Size := 10;
mmo1.Lines.Add(s + edt2.Text);
end;

用字体在WIN下好用,在ANDROID里不行
const
iMax = 20;
var
s: WideString;
i: Integer;
begin
s := edt1.Text;
for i := 1 to iMax - (Length(s)) do
if ord(s[i]) < 19968 then
s := s + #32;
mmo1.Font.Name := '新宋体';
mmo1.Font.Size := 10;
mmo1.Lines.Add(s + edt2.Text);
ShowMessage(IntToStr(ord(',')));
end;

const
iMax = 20;
var
s: WideString;
i, k: Integer;
begin
s := edt1.Text;
if Length(s) < iMax then
for i := 1 to iMax - (Length(s)) do
begin
if ord(s[i]) < 19968 then
s := s + #32;
end;
mmo1.Font.Name := '新宋体';
mmo1.Font.Size := 10;
mmo1.Lines.Add(s + 'Edit');
end;
const
iMax = 20;
var
s: WideString;
i,k: Integer;
begin
s := edt1.Text;
if Length(s) < iMax then
for i := 1 to iMax - (Length(s)) do
begin
if ord(s[i])<19968 then
s := s + #32;
end;
mmo1.Lines.Add(s+'Edit');
end;const
iMax = 8;
var
s: WideString;
i: Integer;
begin
s := Edit1.text;
if Length(s) < iMax then
for i := 1 to iMax - (Length(s)) do
s := s + #32;
mmo1.Font.Name:='新宋体';
mmo1.Text:=s+Edit2.Text;
end;
不对,补的空格,有点问题
我期望的效果是
const
iMax = 8;
var
s: WideString;
i: Integer;
begin
s := '盒子论坛';
if Length(s) < iMax then
for i := 1 to iMax - (Length(s)) do
s := s + #32;
ShowMessage('"' + s + '"');
end;