Re: Adding pre/post escape sequences to a "SAY"
- From: David J Dachtera <djesys.no@xxxxxxxxxxxxxxxx>
- Date: Tue, 20 Feb 2007 21:20:41 -0600
JF Mezei wrote:
$SAY = "WRITE SYS$OUTPUT" exists on pretty much every VMS system, in many
procedures.
However, what I would like to be able to do is to have a SAY that insert
escape sequence before the message, and another escape sequence after the
message.
(for instance, in a scrolling region environment of a VT terminal, have the
SAY cause the message to be written to the top window, and then return to
the bottom window for any other output).
The one thing I could think of is to define a subroutine:
$SAY: subroutine
$write sys$output esc1,p1,esc2
$exit
$endsubroutine
and then in the program, use CALL SAY "This is the message"
Are there any other suggestions on how this could be done efficiently ?
However, one big drawback of this is that CALL SAY is quite different from
WRITE SYS$OUTPOUT in terms of how the arguments are handled.
one can do WRITE SYS$OUTPUT symbol1,symbol2,symbol3
but you can't CALL SAY symbol1,symbol2,symbol3
Well, technically, you can. Here's how it would work:
$SAY: SUBROUTINE
$ write sys$output esc_seq_1,'p1',esc_seq_2
$ exit
$ endsubroutine
Actually, what I would recommend is this:
$ say := call show_text
.
.
.
$ SAY symbol1,symbol2,symbol3
.
.
.
$ exit
$!
$show_text: SUBROUTINE
$ write sys$output esc_seq_1,'p1',esc_seq_2
$ exit
$ endsubroutine
Any way around that would give me the exact same functionality that is
available with WRITE ?
Well, with the caveat of embedded quotes, that's almost plug-and-pray.
Also, is it correct to state that when using:
$CALL SAY "Nodename: ''f$getsyi("SCSNODENAME")'"
That the argument passed to SAY will have already been expanded (eg: any
symbols inside the strings are translated before it enters the subroutine ?)
Absolutely.
--
David J Dachtera
dba DJE Systems
http://www.djesys.com/
Unofficial OpenVMS Marketing Home Page
http://www.djesys.com/vms/market/
Unofficial Affordable OpenVMS Home Page:
http://www.djesys.com/vms/soho/
Unofficial OpenVMS-IA32 Home Page:
http://www.djesys.com/vms/ia32/
Unofficial OpenVMS Hobbyist Support Page:
http://www.djesys.com/vms/support/
.
- Follow-Ups:
- Re: Adding pre/post escape sequences to a "SAY"
- From: n.rieck@xxxxxxxxxxxx
- Re: Adding pre/post escape sequences to a "SAY"
- References:
- Adding pre/post escape sequences to a "SAY"
- From: JF Mezei
- Adding pre/post escape sequences to a "SAY"
- Prev by Date: Re: This is what we're up against!
- Next by Date: Re: I lehrned it from a boook
- Previous by thread: Re: Adding pre/post escape sequences to a "SAY"
- Next by thread: Re: Adding pre/post escape sequences to a "SAY"
- Index(es):
Relevant Pages
|