Statement expected, but expression of type 'Boolean' found
procedure TClientHandleThread.Execute;
begin
while not terminated do
begin
if not FrmChat.IdTCPClient1.Connected then
terminated;
if FrmChat.IdTCPClient1.Connected then
begin
try
FrmChat.IdTCPClient1.ReadBuffer(cb,SizeOf(cb));
synchronize(handleinput);
except
end;
end;
end;
end;
这是一个书上的tcp聊天例子中的部分程序,编译到第六行(红色行)的时候就提示Statement expected, but expression of type 'Boolean' found,这个tcpclient的控件放到窗口界面上的,这部分线程程序也都放到此窗口界面所属单元中的,语法什么的没错啊,怎么解决呢?
[最优解释]
terminate;
[其他解释]
Terminated是TClientHandleThread的基类TThread的访问FTerminated的只读属性,这里应当是要调用
Terminate方法,它里面设置了FTerminated := True。