HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Hours:
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
cancel
Showing results for 
Search instead for 
Did you mean: 

Clear screen

 
jpaulino05
Occasional Contributor

Clear screen

There is any way to clear the screen in openVMS?

Thks in advanced
18 REPLIES
Thomas Ritter
Respected Contributor

Re: Clear screen

Create a command procedure with

$ ESC[0,7] = 27
$ WRITE SYS$OUTPUT "''ESC'[2J''ESC'[1;1H"

Set a symbol to run the procedure.

David B Sneddon
Honored Contributor

Re: Clear screen


$ TYPE/PAGE NLA0:

Dave
Thomas Ritter
Respected Contributor

Re: Clear screen

Thanks David :)
Alanjones_1
Advisor

Re: Clear screen

Dear David

What is mean by NLA0: is it default device specification or ...?

Regards
Balamurali
U CAN !!! U CAN !!!
David B Sneddon
Honored Contributor

Re: Clear screen

NLA0: is the null device. Useful for testing
certain things. Writes always succeed and
reads always return end-of-file. It is a
bit-bucket, black hole, somewhere to send
things when you don't want the output.

e.g. $ show system/output=nla0:

Dave.
Ian Miller.
Honored Contributor

Re: Clear screen

Note that the NLA0: device is good for fast backups when a restore is not required :-)
____________________
Purely Personal Opinion
Bart Zorn_1
Trusted Contributor

Re: Clear screen

Thomas Ritter wrote:

> Create a command procedure with
>
>$ ESC[0,7] = 27
>$ WRITE SYS$OUTPUT "''ESC'[2J''ESC'[1;1H"
>
>Set a symbol to run the procedure.

I would prefer:

$ WRITE SYS$OUTPUT ESC, "[H", ESC, "[J"

Note that there is a difference between this method and TYPE/PAGE NL:

TYPE/PAGE NL: leaves the cursor at the first line of your terminal, whereas the escape sequence puts you on the second line!

Regards,

Bart Zorn
Ian Miller.
Honored Contributor

Re: Clear screen

The other key difference between TYPE/PAGE and WRITE is that the former runs an image but the latter does not.
____________________
Purely Personal Opinion
John Gillings
Honored Contributor

Re: Clear screen

The biggest difference is in device independence (at least partial). Sending an explicit escape sequence assumes an ANSI (VT100) compatible terminal.

TYPE/PAGE NL: determines the terminal type (as set with SET TERMINAL) and issues the "correct" escape sequence to clear the page (assuming your device type is set correctly).

On the other hand, the WRITE command will work on an ANSI terminal regardless of the terminal type set.
A crucible of informative mistakes
Chinraj Rajasekaran
Frequent Advisor

Re: Clear screen

Hi,

Normally i use these commands to clear screen in VMS.

$ set terminal /width=132
(or)
$ set terminal /width=80

regards
Raj
Robert Atkinson
Respected Contributor

Re: Clear screen

Our version of 'clear screen' attached, with about 8 billion escape sequences.....ok, slight exageration there, but don't ask me what they all do, as they've been built up over some years.

Use with '$ TYPE CLS.TXT'.

Rob.
Jan van den Ende
Honored Contributor

Re: Clear screen

Bart.



>$ ESC[0,7] = 27
>$ WRITE SYS$OUTPUT "''ESC'[2J''ESC'[1;1H"
>
>Set a symbol to run the procedure.

I would prefer:

$ WRITE SYS$OUTPUT ESC, "[H", ESC, "[J"

Note that there is a difference between this method and TYPE/PAGE NL:

TYPE/PAGE NL: leaves the cursor at the first line of your terminal, whereas the escape sequence puts you on the second line!


That is of your own doing!

After your sequence, the write will generate an implicit CrLf, puuting you on the next (ie 2nd) line.

However, the ''ESC'[1;1H is a cursor positioning which (at least, as the last element of the sequence) will overrule the need for the added CrLf.

jpaulino05,

as you are new, please review

http://forums1.itrc.hp.com/service/forums/helptips.do?#33

Proost.

Have one on me.

jpe
Don't rust yours pelled jacker to fine doll missed aches.
Bart Zorn_1
Trusted Contributor

Re: Clear screen

Jan,

Did you try it?

DCL knows nothing of escape sequences, so you get the CR/LF anyway. And,"esc>[H" is short for "[1;1H"

Regards,

Bart
Steven Schweda
Honored Contributor

Re: Clear screen

I worry about supplying escape sequences when
"the screen" is no better defined than this,
but if you don't like the carriage control
from WRITE, you might try something like:

$ esc = " "
$ esc[ 0, 8] = 27
$ esc_seq = esc+ "[2J"+ esc+ "[H"
$ read /error = err1 /prompt = "''esc_seq'" /time_out = 0 sys$command line
$ err1:
Jan van den Ende
Honored Contributor

Re: Clear screen

Bart,

I tried, and YOU are right!

Amazing. I have been using that for sooo many years now, and never knew, nor noticed.

Thanks for another bit of education!

Proost.

Have one on me.

jpe
Don't rust yours pelled jacker to fine doll missed aches.
Bart Zorn_1
Trusted Contributor

Re: Clear screen

Jan,

:-)

Steven,

Yes, the READ command can do it without the CR/LF. Unfortunately, the construct is a bit tedious.

Regards,

Bart
Steven Schweda
Honored Contributor

Re: Clear screen

> [...] the construct is a bit tedious.

That's why I put it into a command procedure
instead of typing it interactively.


Some people will complain if they're hanged
with a new rope.
Bart Zorn_1
Trusted Contributor

Re: Clear screen

> That's why I put it into a command procedure
instead of typing it interactively.

Sure, but then your advantage over an image activation decreases!

Bart