这是我线程类中的代码:
unit ClientHandleThread;
interface
uses
Classes,SysUtils;
type
TClientHandleThread = class(TThread)
private
{ Private declarations }
servercmd:integer;
serverMsg:string;
procedure HandleInput;
protected
procedure Execute; override;
end;
implementation
uses Unit1;
{ Important: Methods and properties of objects in visual components can only be
used in a method called using Synchronize, for example,
Synchronize(UpdateCaption);
and UpdateCaption could look like,
procedure TClientHandleThread.UpdateCaption;
begin
Form1.Caption := 'Updated in a thread';
end; }
{ TClientHandleThread }
procedure TClientHandleThread.Execute;
begin
while not Terminated do
begin
if not Form1.IdTCPClient1.Connected then
Terminate
else
try
servercmd:=Form1.IdTCPClient1.IOHandler.ReadInteger;
Synchronize(HandleInput);
except
end;
end;
end;
procedure TClientHandleThread.HandleInput;
begin
case servercmd of
0:
else
end;
end;
end.
case部分怎么判断有没有返回