奇怪:在主菜单的click 的事件中使用exit中止过程编译时 报:[Error] Unit1.pas(606): Statement expected, bu

D

del520

Unregistered / Unconfirmed
GUEST, unregistred user!
奇怪:在主菜单的click 的事件中使用exit中止过程编译时 报:[Error] Unit1.pas(606): Statement expected, but expression of type 'TMenuItem' found(20分)<br />为什么?
 
把代码贴出来看看,你光这么说大家都不太清楚地
 
TMenuItem&amp;apos是什么?
 
procedure TMain.N33Click(Sender: TObject);
var
bf,bo:boolean;
begin
bf:=FileExists(cdir+'/otherField.ini');
Bo:=FileExists(cdir+'/otherTemp.ini');
if Bf and Bo then exit;
end;

就这样简单 编译就通不过。。
 
备注:
cdir是公用变量。

如果我改成

if bo and bf then ShowMessage('xxx');
则正常。
 
肯定是哪里少了分号或者end之类的东西,再仔细看看
 
语句是肯定没有错的,只要换掉那个exit就可以,我将他换成 halt也行。
 
死马当活马医吧!
将exit换到begin...end中试一下。
 
这问题比较怪,这样试试
if (FileExists(cdir+'/otherField.ini')) and
(FileExists(cdir+'/otherTemp.ini')) then
exit;
如果不行,建议重启DELPHI或机器.又或者是你的TMenu出错,试一下重新建一个菜单项
 
同意楼上
 
接受答案了.
 
顶部