MSComm32 is old and therefore still uses the standard Win3/Dos EOF char (Ascii char 26). Modern file systems do not require or use the EOF character to indicate the End of File but some communications protocols may use EOF or, more likely, some other ascii character as a way to indicate 'End of Message' or 'End of Transmision'.
The Ascii table has a number of such characters such as ETX ( 3 ) and EOT ( 4 ) and SComm32 allows you to use any ascii character.
See also the EOFEnable property. If enabled this property will cause an OnComm event to be triggered when the EOFChar is read by the Input property.
It is important to note that the OnComm event is raise AFTER the character was read by the Input property.
Example: Lets assume we're receiving an unknown amount of data which we expect to be terminated by the ASCII EOT (4) character. We don't want to waste time inspecting every individual character to see if it's EOT. We'll simply store all incoming data in a textbox and use the evEof OnComm event to tell us when the EOT character has arrived.
'// Set these values via the IDE or elsewhere in your code such as Form_Load event
InputLen = 0
'// we will read all available chars from the buffer each time we call Input
RThreshold = 1
'// we want OnComm events when any data arrives.
EOFEnable = True
EOFChar = 4
We're ging to react to the ascii EOT character
Private Sub Comm1_OnComm
Select Case Comm1.CommEvent
Text1.Text = Text1.Text & Comm1.Input
'// When this event occurs it means the EOFchar
was received and added to Text1
'// We can now do any processing we want with