# FlushInQ

int FlushInQ (int COMPort);

## Purpose

Removes all characters from the input queue of the specified port.

You can use FlushInQ rather than reading bytes into a buffer to empty the queue.

You can use FlushInQ to flush a flawed transmission in preparation for re-transmission. It alleviates the need to read bytes into a buffer to empty the queue. If the queue is already empty, FlushInQ does nothing.

FlushInQ returns a negative error code if you have not opened the port of if you pass an invalid value for COMPort.

## Parameters

Input
Name | Type | Description
COMPort | integer | A number that indicates the COM port on which to operate. This number is paired with deviceName, which represents the COM port, during the OpenComConfig function call. Default Value: 1—COM1 Valid Range: 1—1,000

## Return Value

Name | Type | Description
result | integer | The result of this function call. This code is a negative value that specifies the type of error that occurred.