Counts the number of characters in the input buffer
COM_COUNT(<nComPort>) --> nTotalCharacters
<nComPort> Designates the port (1 to N) for which the number of
characters in the input buffer is determined.
COM_COUNT() returns the number of characters in the selected buffer.
This function allows you to determine the number of characters in one of
the four possible buffers. This lets you determine how many characters
can be read with the COM_READ() function.
” If an attempt is made to read the number of characters
available in a closed port, the function returns a value of -1.
nCharacter := COM_COUNT(1) // Number of characters-port 1
IF nCharacter > 0
COM_READ(1, 1) // Read 1 character