if dyear.Text<>''  and dmonth.Text<>'' and dday.Text<>'' then想判断不为空时执行操作,上面的写法有问题吗?怎么老提示出错。英文件报错我也看不懂什么意思。
[Fatal Error] myguest.dpr(6): Could not compile used unit 'Unit2.pas'

解决方案 »

  1.   

    if (dyear.Text <>'' ) and (dmonth.Text <>'' )and (dday.Text <>'') then要加括号~~
      

  2.   

    if (dyear.Text<>'')  and (dmonth.Text<>'') and (dday.Text<>'') then
        vardate:=trim(dyear.Text)+'-'+trim(dmonth.Text)+'-'+trim(dday.Text);
    else
      showmessage('请把日期正确填写');
      

  3.   

    if (dyear.Text <>'')  and (dmonth.Text <>'') and (dday.Text <>'') then 
     begin
        vardate:=trim(dyear.Text)+'-'+trim(dmonth.Text)+'-'+trim(dday.Text); 
     end
    else 
      showmessage('请把日期正确填写');或者
    if (dyear.Text <>'')  and (dmonth.Text <>'') and (dday.Text <>'') then 
        vardate:=trim(dyear.Text)+'-'+trim(dmonth.Text)+'-'+trim(dday.Text)//else前面不能有分号
    else 
      showmessage('请把日期正确填写');