The best clear for VAX/VMS
Todd Aven
umdhep at eneevax.UUCP
Wed Jul 10 06:03:21 AEST 1985
In reply to the many people who submitted parts of the solution to
the question: 'What's the best way to clear the screen under VAX/VMS?'
The answer:
First of all, don't assume (you know the saying) that the terminal is
a VT100 emulator, as not everyone uses VT100 emulators (simple, right?).
Second, decide upon how important login speed and clear speed are, because
there are essentially two ways to go about this: either a command
procedure, or an executable.
I. Define the terminal type as a symbol -
You can define at login (sys$sylogin) symbols for the recognized
terminals. For example, if you were using a H19, in SYLOGIN.COM
you would have $ H19 :== @sys$somewhere:h19.com, in which case
you would have h19.com contain two things:
$ term_type == "H19"
$ set term/dev=H19 (if you have defined it for SMG) or
! set term/dev=unknown.
Now, whether you choose to do the clearing with a proc or an image,
the terminal type will be known.
II. Execute proc or image upon command -
Define your clear command as either
$ clear :== run sys$somewhere:clear.exe or
$ clear :== @sys$somewhere:clear.com
A. Clear is an image:
1. Write clear in C and use curses with SMG for max speed.
2. Write clear in whatever and use lib$xxxx to translate
the symbol term_type, then switch to the correct
output routine for clearing that terminal.
B. Clear is a proc:
Translate term_type (trivial) and switch to the appropriate
output routine for clearing that terminal.
My vote is for using SMG, Curses, and C. This is elegant and forces you
to get off your duff and define foreign terminals for SMG. If you wnat
speed, I guess the proc is best, because there is no image activation
and the switching takes very few lines, and allows easy addition of
new terminal clear sequences. You can also get fancy and pass parameters
to the proc to add functions like a hard reset or change emulation mode,
or whatever your heart's desire.
============================================================
|Todd Aven MANAGER at UMDHEP.BITNET |
|Softwear Sweatshop AVEN at UMCINCOM (arpanet, bitnet)|
|High Energy Physics UMDHEP at ENEEVAX.UUCP |
|University of Maryland |
|College Park, MD 20742 |
============================================================
More information about the Comp.sources.unix
mailing list