Article 157812 of comp.os.vms:

$GOTO EXTRACT_ME

In article <1996Oct24.170037.26986@indyvax.iupui.edu>, harvey@indyvax.iupui.edu (James Harvey) writes:
>In article <54gani$uos@news.rhrz.uni-bonn.de>, juengst@saph1.physik.uni-bonn.de (Henry G. Juengst)
>writes:
>> In article <199610211312.PAA00864@net2.fim.fgan.de>, <win@gate.fim.fgan.de> writes:
>>>Hello,
>>>
>>>the better trick is the following command sequence:
>>>
>>>		$ TYPE/PAGE NL:
>>
>> A better trick would be CLEAR SCREEN as standard command in DCLTABLES
>> after the next VMS update... Too complicated since some years, isn't it?!
>
>I assume this was a joke.  If want to be able to type this and have it clear
>the screen, just put a foreign command definition like

It was not a joke. You write "just ...", but for other people it is a real
problem. And this problem is really old. Just look into the articles from
many users. They ask how to clear a screen. The right (VMS like) answer
should be "HELP CLEAR SCREEN", not an ugly DCL trick.

This situation costs time and money - for the VMS customers.

>
>$ CLE*AR == "TYPE/PAGE NL:!"

I use "CLS:==TYPE/PAGE NL:". But this is a hack.

>
>in your LOGIN.COM file or in SYS$MANAGER:SYLOGIN.COM if you want it to be

Why should every user or system manager in this world solve this problem
again and again?

>defined for all users.  Then you can type silly things like
>
>$ CLEAR SCREEN
>$ CLEAR OFF THE TABLE NOW, PLEASE

I do not like silly things like this one. The syntax and semantics has
to be clear. In your example it is not.

>
>and it will clear the screen.  Don't forget the "!"; it's what makes it ignore
>the stuff you type after the initial keyword.  Hopefully, Digital has better
>things to do with their time.  :-)

They have time enough (ms nt, unix...;-).

There are many other examples of missing commands and qualifiers, "solved"
with foreign commands, e.g. SET DISPLAY without ACCESS_CONTROL qualifier
(although a subroutine for this problem exists), no BELL_VOLUME qualifier
and other options from - mmmh - xset, no verb for AUTHORIZE, SYSGEN, SYSMAN
etc., no DCL command for the useful SYS$FORCEX system service (I have
written one with a real DCL definition) etc. etc..

Another important point is, that in most cases there is no HELP available
for foreign (narrow unix style) commands.

Just to show that problems like "clear screen" could be solved once for
ever without much work, I add a small example. Extract this article as
command script, start it (creates [.CLEAR]) and start "MMS", "MMS
INSTALL_SYSTEM". This will produce the missing command and help (login
again after the final installation to get the current DCL table and the new
verb).

>--
>James Harvey  harvey@iupui.edu  Disclaimer: My opinions; I don't speak for IU.

Henry

PS: Has anybody an idea how to solve the margin problem in the HLP files?
    RUNOFF helps a little bit, but it is not very nice, too much fumbling
    with .lm and .rm.

$EXTRACT_ME:
$CREATE/DIRECTORY/VERSION_LIMIT=2 [.CLEAR]
$CREATE [.CLEAR]CLEAR.CLD
$DECK
!*********************************************
!* DCL command definitions of the verb CLEAR *
!*********************************************

define verb CLEAR
  parameter P1
    label=OPTION
    prompt="Clear what"
    value(required,type=CLEAR_OPTION)

define type CLEAR_OPTION
  keyword SCREEN
    syntax=CLEAR_SCREEN
    value

define syntax CLEAR_SCREEN
  image CLEAR_SCREEN
  qualifier DEVICE
    nonnegatable
    value(required,type=$device)
$EOD
$CREATE [.CLEAR]CLEAR.RNH
$DECK
!CLEAR help text
noflags
rm 77
lm 0
1 CLEAR
br
Clears a screen and in later implementations perhaps other things like
counters.
sk
Format
sk;.lm+2;.rm-2
CLEAR option
lm-2;.rm+2
!-----------------------------------------------------------------------------
2 SCREEN
rm-2
sk
Clears the screen of the character cell display or terminal emulator window
owned by the process or another one specified by its device name.
sk
Format
sk;.lm+2;.rm-2
CLEAR SCREEN
lm-2;.rm+2
3 /DEVICE
rm-2
lm+2;.rm-2
sk
/DEVICE=device-name
sk;.lm-2;.rm+2
 Controls the device name of the screen which will be cleared.
sk
3 Bugs
sk
The CLEAR SCREEN command without a qualifier works fine, but it does not return
an error status if it fails.
sk
If one uses the device of another process, then the CLEAR SCREEN command
waits until it gets an input from the other process input device.
sk
3 Examples
sk
literal
1.$ CLEAR SCREEN
end literal
sk
The CLEAR SCREEN command in this example clears the screen of the current
process.
sk
literal
2.$ SHOW USERS/FULL/NODE/INTERACTIVE
        OpenVMS User Processes at 26-OCT-1996 19:42:32.40
      Total number of users = 1,  number of processes = 2

   Username      Node   Process Name       PID     Terminal
   ELCH         VISKPA  This is me==:-)  21E003A8  FTA43:
   ELCH         VISKPA  qay'be' Qapla'   21E00496  FTA45:
  $ CLEAR SCREEN/DEVICE=FTA45:
end literal
sk
The CLEAR SCREEN command in this example clears the screen with the device
name FTA45:.
$EOD
$CREATE [.CLEAR]CLEAR_SCREEN.FOR
$DECK
      PROGRAM CLEAR_SCREEN
      IMPLICIT NONE


**************************************************************************
* This small program clears the screen of a character cell display or    *
* terminal emulator window. An optional qualifier /DEVICE can be used to *
* specify the device name of the screen.                                 *
* Author: Henry G. Jüngst (juengst@saph1.physik.uni-bonn.de), Oct. 1996  *
* This is public domain software. Use it at your own risk.               *
**************************************************************************


*******************
* VMS definitions *
*******************

      INCLUDE '($CLIMSGDEF)'
      INCLUDE '($SSDEF)'
      INCLUDE '(CLI$ROUTINES)'

********************************
* CLEAR_SCREEN local variables *
********************************

      INTEGER MY_CLI_GET_VALUE_STATUS
      INTEGER MY_CLI_PRESENT_STATUS
      INTEGER MY_DEVICE_NAME_LENGTH
      CHARACTER*1024 MY_DEVICE_NAME_STRING
      INTEGER MY_PASTEBOARD_ID

********************************
* Check for /DEVICE qualifier. *
********************************

        MY_CLI_PRESENT_STATUS=CLI$PRESENT('DEVICE')
        IF (MY_CLI_PRESENT_STATUS.EQ.CLI$_DEFAULTED .OR.
     &   MY_CLI_PRESENT_STATUS.EQ.CLI$_PRESENT) THEN
          !*********************************************************
          !* Take the output device name from the qualifier value. *
          !*********************************************************

          MY_CLI_GET_VALUE_STATUS=CLI$GET_VALUE('DEVICE',
     &     MY_DEVICE_NAME_STRING,MY_DEVICE_NAME_LENGTH)
          IF (MY_CLI_GET_VALUE_STATUS.NE.SS$_NORMAL) THEN
            CALL LIB$STOP(%VAL(MY_CLI_GET_VALUE_STATUS))
          ENDIF
        ELSE IF (MY_CLI_PRESENT_STATUS.EQ.CLI$_ABSENT) THEN
          MY_DEVICE_NAME_LENGTH=0
        ELSE
          CALL LIB$STOP(%VAL(MY_CLI_PRESENT_STATUS))
        ENDIF

*******************************************************
* Create new pasteboard and let SMG clear the screen. *
*******************************************************

        IF (MY_DEVICE_NAME_LENGTH.NE.0) THEN
          CALL SMG$CREATE_PASTEBOARD(MY_PASTEBOARD_ID,
     &     MY_DEVICE_NAME_STRING(1:MY_DEVICE_NAME_LENGTH),
     &     %VAL(0),%VAL(0),%VAL(0),%VAL(0),%VAL(0))
        ELSE
          CALL SMG$CREATE_PASTEBOARD(MY_PASTEBOARD_ID,
     &     %VAL(0),%VAL(0),%VAL(0),%VAL(0),%VAL(0),%VAL(0))
        ENDIF

**************************
* Delete the pasteboard. *
**************************

        CALL SMG$DELETE_PASTEBOARD(MY_PASTEBOARD_ID,0)
      END
$EOD
$CREATE [.CLEAR]DESCRIP.MMS
$DECK
FFLAGS=-
 /EXTEND_SOURCE-
 /CONTINUATIONS=99-
 /CHECK-
 /NODEBUG-
 /OPTIMIZE-
 /NOLIST-
 /NOWARNINGS
!/WARNINGS=(ALL,NOULTRIX,NOVAXELN) --> required on VAX, does not work on AXP...


ALL : CLEAR_SCREEN.EXE,CLEAR.HLB
	-@ WRITE SYS$OUTPUT "Done."


CLEAR_SCREEN.EXE : CLEAR_SCREEN.OBJ
  $(LINK)/NOTRACEBACK/EXECUTABLE=$(MMS$TARGET) $(MMS$SOURCE_LIST)

CLEAR.HLP : CLEAR.RNH
  $RUNOFF/OUTPUT=$(MMS$TARGET) $(MMS$SOURCE_LIST)

CLEAR.HLB : CLEAR.HLP


CLEAN :
  -@ IF "''F$SEARCH("CLEAR*.EXE")'".NES."" THEN DELETE/NOCONFIRM CLEAR*.EXE;*
  -@ IF "''F$SEARCH("CLEAR.HLB")'".NES."" THEN DELETE/NOCONFIRM CLEAR.HLB;*
  -@ IF "''F$SEARCH("CLEAR.HLP")'".NES."" THEN DELETE/NOCONFIRM CLEAR.HLP;*
  -@ IF "''F$SEARCH("CLEAR*.OBJ")'".NES."" THEN DELETE/NOCONFIRM CLEAR*.OBJ;*


INSTALL_SYSTEM :
  SET SYMBOL/SCOPE=NOGLOBAL
  SET PROCESS/PRIVILEGE=(BYPASS,SYSPRV,CMKRNL)
  COPY/LOG/PROTECTION=(S:RE,O:RWED,G:RE,W:RE) -
   CLEAR_SCREEN.EXE SYS$COMMON:[SYSEXE]
  PURGE/LOG SYS$COMMON:[SYSEXE]CLEAR_SCREEN.EXE
  LIBRARY/HELP/REPLACE/LOG SYS$HELP:HELPLIB CLEAR
  COPY/LOG/PROTECTION=(S:R,O:RWD,G:R,W:R) CLEAR.CLD SYS$COMMON:[SYSLIB]
  PURGE/LOG SYS$COMMON:[SYSLIB]CLEAR.CLD
  SET COMMAND/TABLE=SYS$COMMON:[SYSLIB]DCLTABLES.EXE-
   /OUTPUT=SYS$COMMON:[SYSLIB]DCLTABLES.EXE SYS$SHARE:CLEAR.CLD
  INSTALL REPLACE SYS$SHARE:DCLTABLES.EXE
  @ WRITE SYS$OUTPUT "New DCL table installed on the local host. Do not forget"
  @ WRITE SYS$OUTPUT "to install the new DCL table in the whole cluster:"
  @ WRITE SYS$OUTPUT "  $SYSMAN"
  @ WRITE SYS$OUTPUT "  SET ENVIRONMENT/CLUSTER"
  @ WRITE SYS$OUTPUT "  DO INSTALL REPLACE SYS$SHARE:DCLTABLES.EXE"
$EOD
$DIRECTORY/SIZE=ALL/PROT/DATE=MODIFIED/WIDTH=FILE=21 [.CLEAR]
$EXIT

--
juengst@saph1.physik.uni-bonn.de         [131.220.161.1]  (Internet)
omni:.de.uni-bonn.physik.saph1::juengst                   (DECnet/OSI, phase V)
saph1::juengst                           [26.358]         (DECnet, phase IV)

Any opinions in this mail are my own.


