X
xiaoyaozh
Unregistered / Unconfirmed
GUEST, unregistred user!
有这样一段代码:
procedure TForm1.Button1Click(Sender: TObject);
begin
case ComboBox2.ItemIndex of
0:begin
if not(MsComm1.CommPort=1)
then
MsComm1.CommPort:=1;
end;
1:begin
if not(MsComm1.CommPort=2)
then
MsComm1.CommPort:=2;
end;
End;
End;
当反复选Combobox2决定COM口时,就会出错,说COMMPORT已经打开
哪里的问题?
procedure TForm1.Button1Click(Sender: TObject);
begin
case ComboBox2.ItemIndex of
0:begin
if not(MsComm1.CommPort=1)
then
MsComm1.CommPort:=1;
end;
1:begin
if not(MsComm1.CommPort=2)
then
MsComm1.CommPort:=2;
end;
End;
End;
当反复选Combobox2决定COM口时,就会出错,说COMMPORT已经打开
哪里的问题?