procedure TForm1.Button1Click(Sender: Tobject);
var s:string;
I,e,c:integer;
begin
s:=memo1.text;
e:=0;
c:=0;
for I:=1 to length(s) do
begin
if (ord(s[I])>=33)and(ord(s[I])<=126) then
begin
inc(e);
label1.caption:='英文字数:'+inttostr(e);
end
else if (ord(s[I])>=127) then
begin
inc(c);
label2.caption:='中文字数:'+inttostr(c div 2);
end;
end;
end;
var s:string;
I,e,c:integer;
begin
s:=memo1.text;
e:=0;
c:=0;
for I:=1 to length(s) do
begin
if (ord(s[I])>=33)and(ord(s[I])<=126) then
begin
inc(e);
label1.caption:='英文字数:'+inttostr(e);
end
else if (ord(s[I])>=127) then
begin
inc(c);
label2.caption:='中文字数:'+inttostr(c div 2);
end;
end;
end;
解决方案 »
- 那位大虾有关于tsslhttpcli与tsslhttpserver通讯的demo啊
- 如何设置TreeView节点文字的颜色?
- 如何吃掉消息??
- 释放资源,有哪个语句好
- 第一次用quick report ,问一个简单的问题。
- 求救!!!建多级树的原代码,高分相送!
- "无法找到动态链接库VNSAPI32.dll"是什么错误?如何解决?
- 怎样用Delphi实现动态域名解析,我想针对ADSL、拨号上网的用户开发一个软件
- 我想要mxoutlookbarpro的帮助文档,谁有吗?
- 有些原来的控件在D6使用中需要Dsgnintf.dcu怎么办啊,我改成D6的哪个什么D.....dcu没有用啊
- 如何把我的程序放到启动中去?
- 怪事,一条SQL语句在SQL Explorer和SQL7 query analyse中执行良好 ,但在程序中出错
var s:string;
i,e,c:integer;
begin
s:=memo1.text;
e:=0;c:=0;
for i:=1 to length(s) do
begin
if (ord(s[i])>=33)and(ord(s[i])<=126) then
begin
inc(e);
label1.caption:='英文个数:'+inttostr(e);
end
else
if (ord(s[i])>=127) then
begin
inc(c);
label2.caption:='中文个数:'+inttostr(c div 2);
end;
end;
end;
我就不再抄一遍了。