TTBRDCST
Enable a program to trap broadcast messages
|
|
VSupported on OpenVMS
|
|
xcall TTBRDCST(channel, option[, ^XTRNL(ast_routine)])
Arguments
channel
An expression that evaluates to a channel number specified in a previous OPEN statement. (n)
option
One of the following actions taken: (n)
Broadcast messages appear at the terminal. This option is equivalent to the DCL SET TERMINAL/BROADCAST command.
Broadcast messages do not appear at the terminal. This option is equivalent to the DCL SET TERMINAL/NOBROADCAST command.
Broadcast messages do not appear at the terminal, and ast_routine is executed whenever a message is broadcast to the terminal.
ast_routine
(optional) A subroutine to be executed as an AST (asynchronous trap). AST routines that don’t use the SLEEP statement or any Synergy DBL I/O statements or XCALLs are supported.
Discussion
The TTBRDCST subroutine enables a program to “trap” messages broadcast to a terminal.
The ast_routine is called with two arguments: the channel number of the terminal to which the message was broadcast and the message text.
When ^XTRNL() is used in an argument list, as in the syntax for this subroutine, the return value is passed to the subroutine by value, rather than by descriptor. Therefore, if you use int4_var = ^XTRNL(ast_routine)
or int4_var = %xaddr("ast_routine") to get the address of a routine before using TTBRDCST, you must then use the following: xcall ttbrdcst(channel, option, ^VAL(int4_var))
Broadcast message trapping is implemented using temporary mailboxes and the BRDCSTMBX terminal attribute. If you change the broadcast and BRDCSTMBX terminal attributes through a call to TTBRDCST and you don’t reset them before you exit your Synergy program, the runtime resets the attributes on exit. If you use the SPAWN subroutine, you must disable broadcast message trapping and close the terminal. Otherwise, the SPAWN fails. |