Home > Back-end >  Delphi commportdrv getdata method
Delphi commportdrv getdata method

Time:10-02

Everyone a great god, Delphi commportdrv getdata method (program), what is the meaning of ah, the next time a getdata, dbuf the values will change?


 function TCommPortDriver. Getdata (var dbuf: string) : word; 
Var
Nread, ret: dword;
I: integer;
P: pchar;
The begin
NRead:=0;
Ret:=0;
Dbuf:=';
If not Connected then Connect;
If (ReadFile (FComPortHandle, FTempInBuffer ^, FComPortInBufSize, nread, nil)) then
The begin
//data back buffer
Ret:=nread;
P:=FTempInBuffer;
If nread & gt; 0 then
For I:=0 to do nread - 1
The begin
Dbuf:=dbuf + p ^;
Inc (p);
end;
end;
Result:=ret;
end;

CodePudding user response:

CodePudding user response:

On the second floor, what do you mean?
  • Related