大
大愚
Unregistered / Unconfirmed
GUEST, unregistred user!
动态生成SPCOM,参数是字符串形式,从INI文件中读取
ccom:=tcomm.Create(Application);
ccom.CommName:=CheckListBox1.Items[ComCount];//com口列表;
ccom.BaudRate:=strtoint(ini.ReadString(CheckListBox1.Items[ComCount], 'Baud', '9600'));
ccom.ByteSize:=ini.ReadString(CheckListBox1.Items[ComCount], 'ByteSize', '_8');//ccom.ByteSize的类型是枚举类型的,该如何赋值?
用
if ini.ReadString(CheckListBox1.Items[ComCount], 'ByteSize', '_8')='_8' then
ccom.ByteSize:=_8;
很麻烦的,我不想用。
ccom:=tcomm.Create(Application);
ccom.CommName:=CheckListBox1.Items[ComCount];//com口列表;
ccom.BaudRate:=strtoint(ini.ReadString(CheckListBox1.Items[ComCount], 'Baud', '9600'));
ccom.ByteSize:=ini.ReadString(CheckListBox1.Items[ComCount], 'ByteSize', '_8');//ccom.ByteSize的类型是枚举类型的,该如何赋值?
用
if ini.ReadString(CheckListBox1.Items[ComCount], 'ByteSize', '_8')='_8' then
ccom.ByteSize:=_8;
很麻烦的,我不想用。