Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- CA-Clipper Tools . Books 1-3 - <b>com_close()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 COM_CLOSE()
 Clears the receiving buffer and closes the com port
------------------------------------------------------------------------------
 Syntax

     COM_CLOSE(<nComPort>) --> lClosed

 Argument

     <nComPort>  Designates which port is closed, COM1(1) to COM4(4).

 Returns

     A return of .T. indicates that the port is open and can be closed
     successfully.

 Description

     This function closes one of the ports (1 to 4).  This means that the
     buffer is cleared, and all signals in the modem control register (MCR)
     are deactivated.  Characters remaining in the buffer are lost.  The DTR
     and RTS signals become inactive, and any existing modem connection is
     broken.

 Note

     Warning!  All characters in the buffer are cleared, and the status
     register is set to 0.  Existing connections are always broken!

 Example

     nCharacter  :=  COM_COUNT(1)      // How many characters in
                                       // the buffer ?

     IF nCharacter > 0
        * Read everything from buffer!
        cContent  :=  COM_READ(1, nCharacter)
     ENDIF

     COM_CLOSE(1)


See Also: COM_OPEN() COM_INIT() COM_DTR() COM_RTS()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson