Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Novlib 3.30 Online Reference - <b> spxevtconget()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 SPXEvtConGet()
------------------------------------------------------------------------------
 Purpose:
 Get the SPX connection that caused the latest event.

 Syntax:
 niConNum = SPXEvtConGet()

 Parameters:
 None.

 Returns:
 A numeric value (signed short int).

 Description:
 SPXEvtConGet() returns the connection number of the SPX connection that
 caused the latest event to occur, resulting in an event function being run.

 Example:
 // To connect to user IAN as an SPX partner and automatically display
 // incoming packets from him on the bottom line of the screen by
 // setting an event:

 PUBLIC nConnNo
 cPacket := str( recno())
 if UsrConNumLst( "IAN" ) > 0
    nConnNo = UsrConNumLst()
    cAddress:=WSNetAddrGet(nConnNo) + WSNodeAddrGet(nConnNo) + "4545"
    if( nConnNo := SPXConnect( cAddress ) > 0 )
       SPXEvtIni( "ONSPX" )
    endif
 endif
 FUNCTION ONSPX()
    LOCAL cPacket
    if( nConnNo == SPXEvtConGet() )
       cPacket := SPXPktGet( nConnNo )
       @ 24,0 say cPacket
    endif
 return NIL

 Notes:
 This function only works with CA-Clipper 5.x.

See Also: SPXConnect() SPXPacketGet() SPXPacketSend() SPXInstalled() SPXEvtIni()

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