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_errcodes()</b> - define error codes http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
   tp_errcodes() - define error codes

   tp_errcodes()

   Some functions return numeric error codes.  These codes are
   identified by the name nError in this documentation, and listed in
   the Error Codes section.  To check for specific errors, you must
   compare the function's return value to the error codes.
   tp_errcodes() creates a number of public variables whose names all
   start with TE_ and sets them to the values of the corresponding error
   codes.  You may then use those names instead of numeric values in
   checking for errors.

   [5.0] Under Clipper 5.0, this function exists but it does nothing.
   Instead, all error names are defined as manifest constants in the
   telepath.ch header file.

   It is only necessary to call tp_errcodes() once in a program, usually
   during startup or initialization.

   Example: (Summer '87)

       * During initialization:
       tp_errcodes()

       * Later:
       tp_send(1, "User name: ")       && Prompt for user name
       cUser = tp_recvln(1, 16)        && Get user name
       if tp_error() == TE_NDCD
           tp_close()                  && Carrier lost; they hung up!
           quit
       endif

See Also: tp_errmsg() tp_error() Error Codes

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