- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: DCL script to sound BELL without scrolling ter...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-06-2010 06:08 AM
тАО09-06-2010 06:08 AM
DCL script to sound BELL without scrolling terminal
My first thought was to put
WRITE SYS$OUTPUT BELL
in a loop. This gives me beeping but unfortunately every write causes a line feed on my 24 line DECTerm and so the
helpful warning message gets scrolled out of
visibility.
Any ideas on stopping the scrolling?
For now I rewrite the whole 20 line help text
every 10 seconds with a beep.
Note that I have BELL defined as per a
Hoffman Labs example
BELL = "*"
BELL[0,8] = 7
With more effort I could send the messages to our standard logging system (based on syslog), but I was hoping for something quick and easy.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-06-2010 06:29 AM
тАО09-06-2010 06:29 AM
Re: DCL script to sound BELL without scrolling terminal
$ BELL = " "
$ BELL[0,8] = 7
$ ESC = " "
$ ESC[0,8]=27
$ curup = ESC+ "[A"
$loop: write sys$output curup,bell
$ goto loop
This even works on an Xterm.
Real VTn terminals could do it more fancy:
one could enable the status line, and put the bell there without destroying or scrolling the main screen content.
But I don't have a VT manual at hand right now to find the right sequences.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-06-2010 06:52 AM
тАО09-06-2010 06:52 AM
Re: DCL script to sound BELL without scrolling terminal
read /prompt =
I haven't tried it with a BEL, but that's the
usual way of suppressing the usual line
advance in terminal output.
I figure that they'll add a /NONEW_LINE to
WRITE about the same time as they add SHOW
VERSION, so I'm not holding my breath.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-06-2010 06:52 AM
тАО09-06-2010 06:52 AM
Re: DCL script to sound BELL without scrolling terminal
$ BELL = " "
$ BELL[0,8] = 7
$ ESC = " "
$ ESC[0,8]=27
$ curup = ESC+ "[A"
$!loop: write sys$output curup,bell
$ on conttrol_y then goto done
$loop:
$ write sys$output eSc,"[1$}",ESC,"[2$~"
$ write sys$output "this is the status line.",bell
$ goto loop
$done:
$ write sys$output eSc,"[0$}"
$ write sys$output "Here we are back."
This displays the text (including bell) in the status line until done: is reached, where the display is switched back to the main screen.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-06-2010 07:10 AM
тАО09-06-2010 07:10 AM
Re: DCL script to sound BELL without scrolling terminal
Startup logging (established via the STARTUP_P2 system parameter) can be used and useful here, as more immediate notifications via MAIL, or syslog, push notifications via XMPP, HTML5 Notifications or whatever protocols out to modern mobile clients, or whatever reporting mechanisms might be in use at the site.
Conceivably, the whole of the startup log could end up posted on a web server, possibly also with a scan for "new" errors that also gets posted to the web server. (It'd be nice if VMS actually included a web server, but there are ways to implement that on VMS or to toss the information over to a more, um, encompassing server operating system.
At its simplest...
$ MAIL whatever.txt -
/SUBJECT="whatever" -
"whomever@example.com"
or
$ MAIL whatever.txt -
/SUBJECT="whatever" -
"@VmsMailDistList"
or some such. Or a little more, for sending out a push.
Yes. Bells are easy. But inevitably and as you've already discovered, important information inevitably scrolls off these pesky old terminal displays.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-06-2010 07:21 AM
тАО09-06-2010 07:21 AM
Re: DCL script to sound BELL without scrolling terminal
But working on the BEL problem is more fun.
alp $ type bel.com
$!
$! Ring the terminal bell P1 times at P2 intervals.
$! Defaults: P1 = 1, P2 = 00:00:01.
$!
$ if (p1 .eqs. "") then p1 = 1
$ if (p2 .eqs. "") then p2 = "00:00:01"
$!
$ bel = ""
$ bel[0, 8] = %x07
$!
$ loop_top:
$ read /error = read_err /prompt = 'bel' /time_out = 0 sys$command line
$ read_err:
$ p1 = p1- 1
$ if (p1 .gt 0)
$ then
$ wait 'p2'
$ goto loop_top
$ endif
$!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-06-2010 02:06 PM
тАО09-06-2010 02:06 PM
Re: DCL script to sound BELL without scrolling terminal
Much as I like Steven's READ/PROMPT hack, there are some things that DCL is good at, and then there's everything else. Sending unformatted binary output to a terminal is part of "everything else". For proper, fine grained control of I/O you need to use system services directly, or through an HLL RTL.
Even if you don't have a compiler license, you can always use MACRO32 to generate any output you want. The code will work on any OpenVMS system. Don't be afraid of MACRO, it's just another programming language, and for simple tasks like this is can be as compact as just about anything else. I've attached a sample. Even with code to read and parse a command line to control the count, it's not much longer than Steven's DCL example.
Download the attachment and rename it to BELLS.MAR, then
$ MACRO BELLS
$ LINK BELLS
$ MCR SYS$DISK:[]BELLS
it will send
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-06-2010 02:24 PM
тАО09-06-2010 02:24 PM
Re: DCL script to sound BELL without scrolling terminal
On second thoughts, I realise that Steven's idea can be exploited for more functionality... First we can use the /TIME_OUT as the timer, rather than WAIT, and, code it so if the user hits RETURN the beeps stop before the counter is reached.
$ count=F$INTEGER(p1)+1
$ int=F$INTEGER(p2) ! in seconds
$ IF int.LE.0 THEN int=1
$ bel[0,8]=7
$ SET NOON
$ Loop: count=count-1
$ IF count.GE.0 THEN READ/ERROR=Loop/PROMPT="''bel'"/TIME_OUT='int' SYS$COMMAND in
Note that using F$INTEGER means that the READ command is valid regardless of user input. Non-numeric input results in default count and interval.