Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- NetLib for Clipper, Version 6.0 - n_ipxrecv( [ @<cbuffer> [, @<hnetaddress> ] ] ) http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
N_IPXRECV( [ @<cBuffer> [, @<hNetAddress> ] ] )


Parameters

<cBuffer>
Name of a memory variable to receive the message. It must be passed by 
reference (that is, prefixed with @).

<hNetAddress>
Name of a memory variable to receive the sender's network address. It 
must be passed by reference (that is, prefixed with @).


Returns

Logical true if an IPX message has been received, false if one has not.


Description

Determines if an IPX message is waiting on the queue and, optionally, 
retrieves it.

When the function is called with no arguments, the return value will 
indicate whether an IPX message is waiting in NetLib's internal receive 
queue. You 'should not delay too long before reading the message, since 
space in the queue is limited.

Rather than using N_IPXRECV() to check periodically for messages, you 
may prefer to set an event trap with N_ONIPX(). This function enables 
you to specify a user-defined procedure that will be called whenever an 
IPX message is received.

If a message is waiting on the queue and a reference to a memory 
variable is passed as the first or only argument, the message will be 
transferred from the queue to the variable.

If a reference to a memory variable is passed as a second argument, the 
sender's network address will be stored in the variable.


Example

// Collect a message when one comes in.
IF N_IPXSTATUS() = 'A'
  N_ONIPX('GetIPX')
ENDIF
.
.
.
PROCEDURE GetIPX
LOCAL cBuffer, cNetAddr, cServer, cSave, nStation
   IF N_IPXRECV(@cBuffer, @cNetAddr)
      nStation = N_WHOAREYOU(cNetAddr, @cServer)
      cSave = N_SERVER(cServer)
      ? 'From: ', N_WHOAMI(nStation)
      ? 'Message: ', cBuffer
      N_SERVER(cSave)
      cBuffer := ""
      ACCEPT 'Enter a reply: ' TO cBuffer
      IF ! EMPTY(cBuffer)
         N_IPXSEND(cNetAddr, cBuffer)
      ENDIF
   ENDIF
RETURN



See Also: N_ONIPX()

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