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 . Book 4-Appendices - <b>ppckey()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 PPCKEY()
 Supervises the communication buffer with key traps
------------------------------------------------------------------------------
 Syntax

     PPCKEY(<nHandle>,[<nKeyValue>],[<nEventMask>])
         --> lSuccess

     Netware: 2.2 and 3.11

 Arguments

     <nHandle>  Designates the communication receiving buffer.

     <nKeyValue>  Designates the key code that is triggered when specific
     events occur.  All values of the CA-Clipper KEYBOARD command are valid.
     Without this parameter, a previously set buffer supervision is removed.

     <nEventMask>  Designates a numeric value that determines the events
     that trigger a key trap.  The value contains an OR operation of various
     events according to the following table.

     Table 31.6:  Event Codes for PPCKEY()
     ------------------------------------------------------------------------
     Value   Sym. Con.           Definition
     ------------------------------------------------------------------------
     1       PPC_RECSUC          Packet received successfully
     2       PPC_RECFAIL         Packet received with errors
     4       PPC_RECBUFF75FULL   Receiving buffer more than 75% full
     8       PPC_RECPACKDISCARD  Packet discarded because of a full receiving
                                 buffer
     16      PPC_SNDFAIL         Failure during sending of a packet
     32      PPC_CONESTAB        Session set up successfully
     64      PPC_CONTERM         Session terminated
     ------------------------------------------------------------------------

     The default value (127) triggers a key trap on each event.  The symbolic
     constants are defined in the header file CTPPC.CH.

 Returns

     PPCKEY() returns .T. when a key code has been set or removed
     successfully.

 Description

     PPCKEY() allows you , independently of the protocol used (IPX, SPX,
     NetBIOS datagram, or NetBIOS session), to supervise a communication
     buffer within a wait state without having to control specific values
     (for example, the number of characters in buffer).  If an event that is
     specified by <nEventMask> occurs, PPCKEY() puts the key code <nKeyValue>
     into the keyboard buffer.  With a previously defined SET KEY procedure,
     you can react to the event immediately .  For example, with PPCEVENT()
     you can determine the event that triggered the key trap.

     If no key code is passed for PPCKEY(), the supervision for the
     communication handle is removed.

 Examples

     .  Put key code 255 into the keyboard buffer at any event:

        IF PPCKEY(nHandle,255)
           ? 'Event handler installed successfully!'
        ELSE
           ? 'Event handler could not be installed!'
        ENDIF

     .  Store key code 255 to the keyboard buffer when a packet is
        received:

        #include "ctppc.ch"

        PPCKEY(nHandle,255,PPC_RECSUC)

     .  Store key code 255 to the keyboard buffer when a session is
        set up or canceled (only for SPX or NetBIOS session communication):

        #include "ctppc.ch"

        PPCKEY(nHandle,255,NUMOR(PPC_CONESTB,PPC_CONTERM))

     .  Remove the event supervision:

        PPCKEY(nHandle)

See Also: PPCEVENT()

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