Hi Andy,

On Friday, August 30, 2002, 6:05:37 PM, you wrote:

AF> hate polling :-)  )  Is there any way to set rebol up to trigger a call
AF> to a routine automatically if any characters are received at the port ?

You bet. :-)

    port: open tcp://etc.
    port/awake: func [port] [
        ; this is called each time you have new data in the port
        ; if you open the port as NO-WAIT now you can just get the
        ; data with COPY PORT
        print copy port
        ; you should return TRUE or FALSE. returning TRUE makes
        ; REBOL exit from the wait function call, while with FALSE
        ; you keep waiting
    ]
    ; now you either use:
    wait port
    ; and get your awake called when there's data, with WAIT
    ; returning only if your awake function returns TRUE,
    ; or you can:
    insert tail system/ports/wait-list port
    ; and your port will be automatically "waited" every time
    ; you call WAIT, i.e. also when you show a window; this is
    ; probably what you are interested in.

Regards,
   Gabriele.
-- 
Gabriele Santilli <[EMAIL PROTECTED]>  --  REBOL Programmer
Amigan -- AGI L'Aquila -- REB: http://web.tiscali.it/rebol/index.r

-- 
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the 
subject, without the quotes.

Reply via email to