edit控件中的text属性,当没有任何值输入时,如何判断它的值是空的?
用edit1.text=''不行呀?edit1.text=null也不行?
因为我要用strtofloat(edit1.text),此函数在edit1.text为空时不正常,我需要提前判断,以避免此情况。
用edit1.text=''不行呀?edit1.text=null也不行?
因为我要用strtofloat(edit1.text),此函数在edit1.text为空时不正常,我需要提前判断,以避免此情况。
解决方案 »
- 请Seamour来接分
- SQL复制问题,广告之后回来结贴(帮顶都谢)
- 自己想开公司,大家给个建议?
- 简单问题,可不知是不是存在BUG
- 问:TListView控件中的OnCustomDrawSubItem()和OnAdvancedCustomDrawSubItem()两事件怎么用啊?
- 请问各位大侠,数据库活动连接串TADOConnection如何传入COM服务器中。
- 大家帮我看看这段代码错在哪里?
- 高分求救公文包的设计?
- 为什么用table控的insert和append方法总是将记录插入到当前记录之前,有没有办法解决?
- 请问如何分发多层系统的客户端
- 我的ExpressPrinting System Version 2.4.8为什么不支持ExpressQuantumGrid Version 4.2 ?
- 如何在TChart中画函数y=100?
procedure TForm1.Button1Click(Sender: TObject);
begin
if Edit1.Text = '' then
showmessage('123')
else
showmessage('456');
end;
try strtofloat(edit1.text)
excepty ................... end;
还是要用yhncom_36(事业我永远追求,对她我永不放弃)的
function Trim(const S: string): string;Trim removes leading and trailing spaces and control characters from the given string S.
aa:=iif(trim(edit1.text)='',0,strtofloat(edit1.text))
iif()函数判断trim(edit1.text)=''判断不出来,但用if then else语句是没问题的。大家看是不是!