| No, you do not have to create the mailbox first. All the /BRDCSTMBX
setting does is enable the reception of broadcast messages by a
mailbox associated with the terminal.
That is, if you associate a mailbox with the terminal (e.g., using
LIB$ASN_WTH_MBX), it will receive broadcast messages if the terminal
is set /BRDCSTMBX, and won't if it isn't. So set your terminal
that way all the time; there's no harm to it.
Just because a mailbox has been set up doesn't mean the messages
will go there instead of the terminal. Actually, the mailbox will
get *copies* of the messages. So the real best solution for handling
your own messages is to
save current state of /BRDCSTMBX
SET TERMINAL /BRDCSTMBX
run program that
calls LIB$ASN_WTH_MBX
saves the current state of /BROADCAST
calls $QIO and sets the terminal /NOBROADCAST, *OR*
calls LIB$SPAWN ('SET TERMINAL /NOBROADCAST')
does its thing
restores state of /BROADCAST
SET TERMINAL /[no]BRDCSTMBX (whatever you saved in step 1)
Of course, you could combine the setting and resetting of (/NOBROADCAST
/BRDCSTMBX) into two QIO operations in your program, which would
be the cleanest way because you wouldn't need a jacket procedure.
I recommend resetting the terminal state as part of an exit handler.
#ken :-)}
|
| Re .-1:
Thanks. I wanted to know how to do this, too. Unfortunately, I
looked through VMSNOTES before thinking to try here, and here it
is already answered! My question now, is
How did you know that?
I found nothing in the io manual in the mailbox section, and
nothing in the on-line help for SET TERMINAL/BRDCSTMBX.
Dan
|