下面是接受程序:
procedure TForm1.Comm1ReceiveData(Sender: TObject; Buffer: Pointer;
BufferLength: Word);
begin
SetLength(strInput, BufferLength);
Move(Buffer^, PChar(StrInput)^, BufferLength);
memo1.lines.add(StrInput);
memo1.lines.add('');
end;谢谢各位大虾
procedure TForm1.Comm1ReceiveData(Sender: TObject; Buffer: Pointer;
BufferLength: Word);
begin
SetLength(strInput, BufferLength);
Move(Buffer^, PChar(StrInput)^, BufferLength);
memo1.lines.add(StrInput);
memo1.lines.add('');
end;谢谢各位大虾
解决方案 »
- 请教大家一个SQL语句
- 【马屁贴】我有一个心愿,就是给本版老大亮剑兄散点分!
- Win98下用WinNT协议访问活动目录(AD)无效
- 皮皮散分系列之七<古道>
- 很奇怪哦!俺在窗体上放个frReport1 再放个Button1 ,执行一下frReport1.ShowReport;,都居然连预览都不出来!!怎么办的?
- 我写了一个系统,软件已经完成了,刚开始写的时候没有给数据库设置密码,想在写完的时候设就可以,但是现在给数据库设置密码,老是出错,
- 如何测出键盘值
- 工作啊,我在找你^^^^^^
- dephi中用哪个函数可以解决两个日期的差,要求精确到分钟!
- 如何列举出一个控件的所有属性,并且得到属性值
- 求DevExpress for D5 整套控件下载,100分相送!!!!
- 如何在Adoconnection控件destroy后恢复ADO连接,解决即给分
改成:
var
StrInput : array[0..100] of byte;Move(Buffer^, StrInput, BufferLength);
这样对(StrInput[i],2)操作。
你试试看,行不行!?
var
Form1: TForm1;
viewstring:string;
i:integer;
strInput: string;implementation{$R *.dfm}procedure TForm1.FormShow(Sender: TObject);
begin
comm1.StartComm;
end;procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
comm1.StopComm;
end;procedure TForm1.Comm1ReceiveData(Sender: TObject; Buffer: Pointer;
BufferLength: Word);
begin
SetLength(strInput, BufferLength);
Move(Buffer^, PChar(StrInput)^, BufferLength);
memo1.lines.add(StrInput);
memo1.lines.add('');
end;
BufferLength: Word);
var str:Array[0..2047] of byte;
i:integer;
begin
Move(Buffer^, str, BufferLength);
for i:=0 to length(str) do
begin
memo1.lines.add(str[i]);
memo1.lines.add('');
end;
end;