1753453 Members
6047 Online
108794 Solutions
New Discussion юеВ

Re: Clear screen

 
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