我想做一个函数:
判断text1.text是否为空,空就提示出错,不再执行下面的代码了,要用户再写。
不为空就执行代码。
判断text1.text是否为空,空就提示出错,不再执行下面的代码了,要用户再写。
不为空就执行代码。
解决方案 »
- ClientSocket/ServerSocket问题?
- 一个令我百思不得奇解的问题!关于字节数!
- 不知道该搜什么关键字的小问题
- 过年想换个新手机(旧的用了4年了),问一下k-java功能有什么用,moto c350v 有这功能吗?
- rave主从报表怎样设置??
- 请问Abstract error是什么意思?通常是什么地方出错呢????
- 关于非可视控件的疑问。
- 一起讨论下delphi 构造
- timer定时器控件timertimer事件的使用问题
- 100分求 tesseract-ocr delphi 怎么调用?
- 帮我解决一下这两个问题,谢谢!
- 大家看CSDN的2003年4月所登出的 SilderWinder的信息了吗?Borland公司的C#编译器,同时还要捆绑Together for C#。你会转向使用SilderWind
begin
if (Sender as TEdit1).Text = '' then exit;
...
end;
if edit1.text='' then
begin
showmessage('出错!');
end
else
........
我试过了,是不行的
因为有多个控件判断时就会弹出好多个出错的窗口的
同样,有时对于showmodal显示的窗口如出错也会自动关闭的。
var
label x;
begin
x: if edit1.text='' then
goto x;//呵呵在这里呀
end;
begin
if Edit1.Text = '' then
begin
Edit1.SetFocus;
Exit;
end;
end;
begin
if Edit1.Text = '' then
begin
Showmessage('Edit1不能為空,請輸入!');
Edit1.SetFocus;
Exit;
end;
end;
begin
if edit1.Text='' then
showmessage('错误');
end;
有的话,试试ActiveManager
i: integer;
begin
for i := 0 to form1.ComponentCount - 1 do
begin
if TEdit(form1.Components[i]).Text = '' then
begin
TEdit(form1.Components[i]).SetFocus;
Showmessage('error!');
exit;
end;
end;
bNull: Boolean;
begin
bNull := False;
bNull := bNull or (Edit1.Text='');
bNull := bNull or (Edit2.Text='');
bNull := bNull or (Edit3.Text='');
bNull := bNull or (Edit4.Text='');
//如果此时 bNull=True ,说明上面四个Edit至少有一个为''
if bNull then ...
end;
begin
//do something
end
else
begin
MessageBox(handle,'输入为空!!','提示',MB_OK+MB_ICONINFORMATION);
Abort;
end;
try it again!!!
begin
showmessage('输入为空');
abort;
end;
begin
if target.Text = '' then
abort
end;
begin
if trim(text1.text) = '' then begin
abort
end;
begin
if trim(text1.text) = '' then begin
showmessage('text1不可以为空!'); abort;
end;
end;