这是个求给定字符串中中英文个数的函数,你自己看有没有用吧
procedure CalcStrNum(Const Input:String;Var Ecount:Integer;Var Ccount:Integer;Var TotalCount:Integer );
var
i:integer;
begin
ccount:=0;
Ecount:=0;
i:=1;
while i<=length(input) do
begin
if (ord(input)>127) then
begin
i:=i+2;
CCount:=Ccount+1;
continue;
end;
i:=i+1;
ECount:=ECount+1;
end;
TotalCount:=Ecount+Ccount;
end;