procedure PeekBlock(var Block; const Len : Word);
Returns a block of received characters but leaves them in the dispatcher buffer.
After using this routine another call to PeekBlock or GetBlock returns the same data.
Block references a block of memory large enough to hold at least Len bytes. If Len bytes of received data are not available, none are returned and an exception is generated.
The following example avoids the possibility of an EBufferIsEmpty exception by assuring that at least 20 bytes are available before peeking at them:
if ApxComPort.InBuffUsed >= 20 then
ApxComPort.PeekBlock(Block, 20);