原机的程序有点坏了,想自己做一个,需要哪些东西?要机子厂家的函数吗?
解决方案 »
- 网络互动教学客户端(做过IM的高手进)
- 如何用EDIT+LISTBOX实现自动完成的下拉框!???
- 闪烁短信的编码是怎么设置的(急)!!!!
- 银行票据打印
- 这是什么错误?
- 怎样用一个ProgressBar来显示ADOQuery的查询进度?
- 使用rave能不能做出自定义报表的功能出来?
- 请问英语四级的成人考试报名截止到什么时候(西安)
- 我做了个报表的COM,使用AdoConnection String进行连接,获取数据,输出报表到EXCEL,有人要吗?
- 菜鸟问题,怎么让程序暂停一段时间
- ■■■■■■■■■ 求主页空间 ■■■■■■■■■■
- oracle数据表迁移到sqlserver,必须用程序实现,有什么好办法?
请问你做过类似的东东吗?到哪 找那个调试软件?
procedure TcommForm.FormCreate(Sender: TObject);
begin
mscomm.commport:=1;
mscomm.settings:='9600,n,8,1';
mscomm.inputlen:=1;
mscomm.inbuffercount:=0;
mscomm.portopen:=true;
ss:='';
i:=0;
j:=0;
assignfile(savef,'save1');
rewrite(savef);
assignfile(readf,'read1');
reset(readf);
end;procedure TcommForm.Button1Click(Sender: TObject);
begin
if mscomm.portopen then
mscomm.portopen:=false;
mscomm.commport:=strtoint(edtCommport.text);
mscomm.settings:=edtCommsetting.Text;
end;
procedure TCommForm.MSCommComm(Sender: TObject);
var
filenrc :char;
buffer :variant;
s1:string;
c :char;
begin
case mscomm.commEvent of
comEvSend:
begin
while not(eof(readf)) do
begin
read(readf,filenrc);
mscomm.output:=filenrc;
j:=j+1;
lblDisplay.caption:=inttostr(j);
if mscomm.outbuffercount>=2 then
break;
end;
end;
comEvReceive:
begin
buffer:=mscomm.Input;
s1:=buffer;
c:=s1[1];
ss:=ss+c;
i:=i+1;
lblDisplay.caption:=c+inttostr(i);
write(savef,c);
if (c=chr(10))or(c=chr(13)) then
begin
lblDisplay.caption:='cr'+inttostr(i);
memDisplay.lines.add(ss);
ss:='';
end;
end;
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
mscomm1.InBufferCount:=0;
mscomm1.InputLen:=0;
mscomm1.RThreshold:=1;
end;procedure TForm1.Button1Click(Sender: TObject);
begin
mscomm1.Settings:=combobox1.Text;
if combobox2.Text='com1' then
mscomm1.CommPort:=1
else
mscomm1.CommPort:=2;
mscomm1.PortOpen:=true;
mscomm1.DTREnable:=true;
mscomm1.RTSEnable:=true;
end;procedure TForm1.Button2Click(Sender: TObject);
begin
mscomm1.PortOpen:=false;
mscomm1.DTREnable:=false;
mscomm1.RTSEnable:=false;
end;procedure TForm1.MSComm1Comm(Sender: TObject);
var
recstr:olevariant;
begin
if mscomm1.CommEvent=2 then
begin
recstr:=mscomm1.Input;
memo1.Text:=memo1.Text+recstr;
end;
end;