Event service routine
- Posted by Bernie Ryan <xotron at bluefrognet.net> May 01, 2003
- 619 views
Manny: This is example of how to do the callback. you need to create a callback using routine_id to create a pointer to your TermIrq procedure. This example is only for you to test the idea and is not a complete working program. procedure TermIrq(integer port) -- do something end procedure sio_term_irq_=define_c_func(Pcomm,"sio_term_irq", {C_INT,C_POINTER,C_INT},C_INT) global function sio_term_irq( integer port,atom TermIrq, atom code) ret=c_func(sio_term_irq_,{port,call_back(routine_id("TermIrq")),code}) if ret=SIO_BADPORT then warnErr("Port is not opened in advance") end if if ret=SIO_WIN32FAIL then warnErr("Calling Win32 function failed") end if if ret=SIO_BADPARM then warnErr("Bad parameter") end if return ret end function Bernie