property OutBuffFree : Word
Returns the number of bytes free in the output buffer.
Use OutBuffFree to assure that the output buffer has enough free space to hold data that you are about to transmit.
The following example checks for sufficient output buffer space to transmit a block of NeededSpace bytes. If enough space is available, the block is transmitted. Otherwise a status trigger is added to detect the required free space. The code assumes that an OnTriggerStatus event handler has already been activated.
if ApxComPort.OutBuffFree >= NeededSpace then
ApxComPort.PutBlock(Data, NeededSpace)
else begin
MyHandle := ApxComPort.AddStatusTrigger(stOutBuffFree);
ApxComPort.SetStatusTrigger(MyHandle, NeededSpace, True);
end;
See also: OutBuffUsed