简单的问题,spcomm控件在程序运行期怎么设置齐偶校验位,它是Tparity型的(50分)

D

dsq1980

Unregistered / Unconfirmed
GUEST, unregistred user!
spcomm控件在程序运行期怎么设置齐偶校验位,它是Tparity型
 
我设置不来,请各位帮忙
 
怎么没人回答啊,高手都上哪了
 
在运行期,动态设定spcomm控件的Parity属性值即可。
如Comm.parity:=evenparity;
 
[Error] Unit1.pas(30): Incompatible types: 'TParity' and 'Integer'
还是不行
 
那就试试Comm.parity:=2;
 
好像可以了,我是这样改的,谢谢chll
Comm1.parity:=Tparity(none);
Comm1.parity:=Tparity(evenparity);
Comm1.parity:=Tparity(markparity);
Comm1.parity:=Tparity(oddparity);
 
接受答案了.
 
我刚才也试了,好像
Comm1.parity;=even;也可以
 
你可以设一个变量来存贮:
comm_parity:TParity;
comm_parity:=even;
comm.parity:=comm_parity;
 
顶部