delphi if的问题。。。

ilostlove 2009-03-04 11:05:27
procedure TForm1.Edit1Change(Sender: TObject);
var stringleng:integer;
begin
begin
stringleng:=edit1.GetTextLen ;
edit2.Text :=inttostr(stringleng);
if stringleng>6 then
showmessage('超过了,不给了')
else
if stringleng<6 then;
showmessage('还可以的');
showmessage('真的不给了');
end;

end;
end.
...全文
186 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
HanChin 2009-03-18
  • 打赏
  • 举报
回复
.....
xhxhmglychd 2009-03-18
  • 打赏
  • 举报
回复
procedure TForm1.Edit1Change(Sender: TObject);
var stringleng:integer;
begin
stringleng:=edit1.GetTextLen;
edit2.Text:=inttostr(stringleng);
if stringleng>6 then
showmessage('超过了,不给了')
else
if stringleng <6 then
showmessage('还可以的');
showmessage('真的不给了'); //无论上面如何的执行,这句始终会无条件地被执行。
end;

有三个以上的选择条件,不如用case 。

sanguomi 2009-03-05
  • 打赏
  • 举报
回复
关DELPHI鸟事
yct0605 2009-03-05
  • 打赏
  • 举报
回复

procedure TForm1.Edit1Change(Sender: TObject);
var stringleng:integer;
begin
stringleng:=edit1.GetTextLen;
edit2.Text:=inttostr(stringleng);
if stringleng>6 then
showmessage('超过了,不给了')
else
if stringleng <6 then
showmessage('还可以的');
showmessage('真的不给了');
end;


╮(╯▽╰)╭
sher12 2009-03-05
  • 打赏
  • 举报
回复
procedure TForm1.Edit1Change(Sender: TObject);
var stringleng:integer;
begin
stringleng:=edit1.GetTextLen ;
edit2.Text :=inttostr(stringleng);
if stringleng>6 then showmessage('超过了,不给了')
else if stringleng <6 then showmessage('还可以的')
else showmessage('真的不给了');
end;


end.

830

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 非技术区
社区管理员
  • 非技术区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧