以下是想对SPCOMM 进行动态设置属性,可是由于类型不相同,该怎么转换??? comm1.CommName:=combobox1.text; //端口号
comm1.BaudRate:=combobox2.text; //波特率
comm1.ByteSize:=combobox3.text; //数据位
comm1.StopBits:=combobox4.text; //停止位
comm1.Parity:=combobox5.text; //校验码
comm1.BaudRate:=combobox2.text; //波特率
comm1.ByteSize:=combobox3.text; //数据位
comm1.StopBits:=combobox4.text; //停止位
comm1.Parity:=combobox5.text; //校验码
解决方案 »
- imagelist中的图像来源
- *******接昨天问,listbox&access数据库???????
- 求用WebBrowser来提取网页中参数的方法。(查过以往的贴子,没有类似的贴子)
- 杭州三汇语音卡
- 如何判断是否为数字字符
- Windows NT 下DELPHI如何进入特权指令?没有特权指令,DELPHI怎样写工控软件?
- 请教一个Fastreport的问题(浮动)
- 求使用ole操作word 的详细代码!!!!!!!!!!!!!!!!!?????????????????
- 【求助】select的数据量太大,程序假死,如何解决??
- TStingList的Free方法和Destroy方法有什么区别?
- ●●●如何去掉Label控件的背景色???
- 请问用adoconnection连接数据库,如何在程序运行能够动态的指定呢,谢谢了
begin
comm1.commname:=combobox1.Text;
comm1.StartComm;
comm1.BaudRate:=strtoint(combobaudrate.Text);
case combodatabits.ItemIndex of
0:comm1.ByteSize:=_5;
1:comm1.ByteSize:=_6;
2:comm1.ByteSize:=_7;
3:comm1.ByteSize:=_8;
end;
case combostopbits.ItemIndex of
0:comm1.stopbits:=_1;
1:comm1.stopbits:=_1_5;
2:comm1.stopbits:=_2;
end;
case comboparity.ItemIndex of
0:comm1.Parity:=None;
1:comm1.Parity:=Odd;
2:comm1.Parity:=Even;
3:comm1.Parity:=Mark;
4:comm1.Parity:=Space;
end;
if comboparity.ItemIndex=0 then comm1.ParityCheck:=false
else comm1.paritycheck:=true;
BitBtn2.Enabled:=false;
end;