Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Telepathy Communications Library - <b>tp_send()</b> - send string http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
   tp_send() - send string

   nSent := tp_send(nPort, cString, [nTimeout])

   nPort       Serial port number.
   cString     String to send.
   nTimeout    Maximum wait time, in seconds.

   Returns     Number of characters sent.

   Sends a string to the serial port.

   If nTimeout is specified, waits up to nTimeout seconds to send if the
   output buffer becomes full.  If nTimeout is omitted or zero, sends as
   much as possible and returns immediately.  -1 for nTimeout waits
   forever (until the string is sent, tp_idle() returns TRUE, or an
   error occurs).

   Example:

       tp_send(1, "Do you hear me, Fred?" + chr(13) + chr(10))

   Bad Example:

       tp_send(1, "Do you hear me, Fred?" + chr(13) + chr(10))
       tp_close(1)

       // If you close the port immediately after sending a chunk
       // of data, the data may still be in the buffer and never be
       // sent.  You can solve this problem by using tp_flush() or
       // the optional nTimeout parameter to tp_close().

See Also: tp_sendsub()

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