HP OpenVMS Systems

ask the wizard
Content starts here

using SMG$SET_BROADCAST_TRAPPING?

» close window

The Question is:

 
   I'm porting some code that we had running
on VMS 5.5-2.  The original programmer made
many calls to SMG$ functions.  One such call
was made to SMG$SET_BROADCAST_TRAPPING with
the parameters 'paste' and 'message'.
   Now, I understand that 'paste' is the id of
a virtual pasteboard created earlier in the
program.  However, I'm a bit confused on
'message'.  I've looked through the on-line
help and found that 'message' is an AST routine,
but I've been able to find out just what exactly
this routine does.
   Could you point me in the direction of some
documentation, that will answer my question.
   Thanks
 


The Answer is :

    SMG$SET_BROADCAST_TRAPPING defines an AST routine to be called when a
    broadcast message is sent to the device to which the specified pasteboard
    is mapped.
 
    What the AST routine does is entirely up to you (the programmer). Typically
    it will set some kind of flag to indicate to the application that a
    message has been received. The application may then use
    SMG$GET_BROADCAST_MESSAGE to retrieve the message and take appropriate
    action.
 
    Note that since you cannot mix AST and non AST level calls to SMG without
    proper synchronisation, you usually cannot call SMG$GET_BROADCAST_MESSAGE
    from the AST routine itself. The common design is to set a flag and call
    SMG$CANCEL_INPUT (the only SMG$ routine you can always call from AST
    level). This will cancel any SMG$READ_xxx call in progress with a
    CANCEL status. The application can then check the flags to see what
    asynchronous event has occurred, action it, then reissue the I/O.
 

answer written or last revised on ( 16-DEC-1998 )

» close window