ComClose Procedure

Closes a previously opened COM port.

Syntax

[ lStatus = ] ComClose ( lPort )

The ComClose procedure syntax has the following parts:

 

Name

Type

Description

lStatus

Long

Status, -1 on failure, 0 on success

lPort

Val Long

Serial port number (1 for COM1, etc.)

Comments

The lPort must be open, or else the function returns -1.

Example

If ComClose(1) < 0

Abort

Endif

See Also

ComGetHandle, ComOpen, ComSetup