[comp.sources.misc] SWING 01/10

u3369429@murdu.OZ (Michael 'I love VMS' Bednarek) (05/07/87)

[I always wondered what a VMS shar looked like.  ++bsa]

Finally.
Here is SWING version '04-May-87' .

(SWING is a VAX/VMS utility for displaying the graphical representation
 of directory trees on a VT100 or VT200 type terminal.)

Because this is strictly a VAX/VMS tool, I packaged it not in the traditional
"shar" format, but as self-unpacking VMS command procedure.

It comes in 10 parts (to keep each part below 16000 characters).
You have to save all 10 parts to files, remove all the mailer header lines
and CONCATENATE them to one single file.

The size of that file should be 278/279 blocks, 4628 lines, 16722 words,
134734 characters.
......................... Cut between dotted lines and save ....................
$!..............................................................................
$!
$! VAX/VMS archive file created by VMS_SHAR2 by Michael Bednarek
$! To unpack, simply execute (@) the file.
$! This archive was created by U3369429     (Michael Bednarek)
$!      at Tuesday 5-MAY-1987 15:12:22.71
$! It contains the following files:
$ File1="AAAREADME.GRC"
$					Check_Sum1=608923510
$ File2="AAAREADME.MB"
$					Check_Sum2=1903215117
$ File3="SWING.HLP"
$					Check_Sum3=1074088111
$ File4="COMPILE.COM"
$					Check_Sum4=691498056
$ File5="SWING.COM"
$					Check_Sum5=308574680
$ File6="ADD_HELP.COM"
$					Check_Sum6=2054584496
$ File7="PULLDOWN.CMN"
$					Check_Sum7=1730483629
$ File8="SWING.CMN"
$					Check_Sum8=108873044
$ File9="ADD_NODE.FOR"
$					Check_Sum9=1165955942
$ File10="ADD_NODE_TO_DISPLAY.FOR"
$					Check_Sum10=862132999
$ File11="ADJUST_NODE_POINTERS.FOR"
$					Check_Sum11=892942250
$ File12="APPEND_NODE.FOR"
$					Check_Sum12=1919626506
$ File13="CHANGE_OPTIONS.FOR"
$					Check_Sum13=1467707090
$ File14="CHANGE_SPEC.FOR"
$					Check_Sum14=943552234
$ File15="CHECK_DIRECTORY_MOVE.FOR"
$					Check_Sum15=874944207
$ File16="CREATE_DIRECTORY.FOR"
$					Check_Sum16=1645950308
$ File17="CRT.FOR"
$					Check_Sum17=1682318580
$ File18="DEFINE_PASTE_BOARD.FOR"
$					Check_Sum18=607869268
$ File19="DEFINE_SMG_LAYOUT.FOR"
$					Check_Sum19=2021349898
$ File20="DELETE_DIRECTORY.FOR"
$					Check_Sum20=2070483756
$ File21="DELETE_FILES.FOR"
$					Check_Sum21=962142516
$ File22="DELETE_NODE.FOR"
$					Check_Sum22=560860264
$ File23="DIR_TO_FILE.FOR"
$					Check_Sum23=1360597721
$ File24="DRAW_SCREEN.FOR"
$					Check_Sum24=1531524034
$ File25="EXIT_SWING.FOR"
$					Check_Sum25=1412173883
$ File26="FILE_TO_DIR.FOR"
$					Check_Sum26=1297052571
$ File27="FIND_NODE.FOR"
$					Check_Sum27=841699280
$ File28="FREE_NODE.FOR"
$					Check_Sum28=1681276343
$ File29="GET_LOCATION.FOR"
$					Check_Sum29=488508780
$ File30="HARDCOPY.FOR"
$					Check_Sum30=623043725
$ File31="HELP.FOR"
$					Check_Sum31=39673853
$ File32="LOAD_DISPLAY.FOR"
$					Check_Sum32=1853444713
$ File33="LOAD_NODES.FOR"
$					Check_Sum33=1763778119
$ File34="MODIFY_FILE_PROT.FOR"
$					Check_Sum34=1767389564
$ File35="MOVE_NODE.FOR"
$					Check_Sum35=1612411967
$ File36="ONE_MORE_LINE.FOR"
$					Check_Sum36=1765044864
$ File37="PD_BAR_CHOICE.FOR"
$					Check_Sum37=2049480641
$ File38="PD_DRAW_BAR.FOR"
$					Check_Sum38=235619723
$ File39="PD_GET_CHOICE.FOR"
$					Check_Sum39=406932811
$ File40="PD_LIST_CHOICE.FOR"
$					Check_Sum40=1076540047
$ File41="PD_LOAD_BAR.FOR"
$					Check_Sum41=521426950
$ File42="PD_UNDRAW_BAR.FOR"
$					Check_Sum42=1031549002
$ File43="PRINT_MESSAGE.FOR"
$					Check_Sum43=422928887
$ File44="RECORD_STRUCTURE.FOR"
$					Check_Sum44=352606196
$ File45="RENAME_DIRECTORY.FOR"
$					Check_Sum45=508944053
$ File46="RESET_TERMINAL.FOR"
$					Check_Sum46=1764303617
$ File47="SET_NOTAB.FOR"
$					Check_Sum47=223822392
$ File48="SM_ALLOW_REPAINT.FOR"
$					Check_Sum48=1363765007
$ File49="SM_REPAINT_SCREEN.FOR"
$					Check_Sum49=408704615
$ File50="SWING.FOR"
$					Check_Sum50=1969922804
$ File51="SWING_ERR_HDL.FOR"
$					Check_Sum51=2118593530
$ File52="UPDATE_SCREEN.FOR"
$					Check_Sum52=1599106581
$ File53="UPDATE_WINDOW1.FOR"
$					Check_Sum53=1780687944
$ File54="ISADIR.MAR"
$					Check_Sum54=1060671991
$ File55="SMGDEF.TXT"
$					Check_Sum55=2120019194
$!========================================
$ Pass_or_Failed="Failed,Passed"
$ nF=0
$ nF=nF+1
$ Copy SYS$Input VMS_SHAR_DUMMY.DUMMY
X      SWING displays the current directory tree on a CRT screen for 
Xinteractive tree manipulation.  It is able to do the following:
X
X      o  SET DEFAULT by moving from node to node with the arrow keys
X	 and exiting SWING when the current node is the directory 
X	 desired.
X
X      o  Rename a subdirectory.
X
X      o  Interactively create a new subdirectory.
X
X      o  Interactively move a subdirectory structure to a new position, 
X	 with all of its children.
X
X      o  Interactively delete a tree structure - each node blinks and 
X	 then disappears as it is deleted.  This graphically does what
X	 the DELTREE type command procedures do.
X
X      o  Create hardcopy of the current directory structure.
X
X      o  Create a "binary save file" so the whole directory doesn't have
X	 to be searched each time SWING is used.
X
X      The SWING program is written entirely in FORTRAN and replaces a 
Xlot of worn out command procedures that have been written over the years. 
XIt allows the user to quickly examine and manipulate a directory 
Xstructure, saving time for the real work at hand.  
X
X      The screen manipulation is handled by the SMG routines and all 
Xeight directory levels are supported.  The screen is switched between 
X80 and 132 columns as the directory tree changes size.  The display 
Xscrolls up and down for long directory trees and commands are either 
Xentered by hitting keys or by a pulldown menu at the top of the screen.
XThere is help while in SWING and a help file is furnished for the VMS 
XHELP library as well.  You have to try SWING to believe it.  It is 
Xproof that computers can be easy to use!
X------------------------------------------------------------------------
X      COMPLEMENTS, SUGGESTIONS AND COMPLAINTS TO THE FOLLOWING:
X
X                       Eric Andresen
X                       General Research Corporation
X                       5383 Hollister Avenue
X                       Santa Barbara, CA  93111
X                       (805)964-7724  Ext. 332
X------------------------------------------------------------------------
$ Name=File'nF
$ Write SYS$Output "creating ",Name
$ Open/Write Out 'Name
$ Open/Read In VMS_SHAR_DUMMY.DUMMY
$Next_Record1: Read/End_Of_File=EOF1 In Record
$ Write Out F$Extract(1,255,Record)
$ Goto Next_Record1
$EOF1: Close Out
$ Close In
$ Delete VMS_SHAR_DUMMY.DUMMY;*
$ Checksum 'Name
$ Success=F$Element(Check_Sum'nF.eq.CHECKSUM$CHECKSUM,",",Pass_or_Failed)
$ Write SYS$ERROR "Checking CHECKSUM. ''Success'"
$ nF=nF+1
$ Copy SYS$Input VMS_SHAR_DUMMY.DUMMY
XFeatures modified/added to SWING by Michael Bednarek:
X
Xo  A few arrays needed to be dimensioned
X      Dimension blabla(0:SOME_PARAMETER)
X                       ^^
X
Xo  A few IF-statements needed to be turned around. E.g.:
X      If (array(i).eq.0 .and. i.lt.Bound_of_i)
X   must be written as
X      If (i.lt.Bound_of_i .and. array(i).eq.0 )
X
Xo  Added {Q,q} as commands to quit (identical to {E,e,X,x,^Z}
X   Removed RETURN as a command to quit.
X
Xo  Changed a flag in the HELP routine to look for HLP$LIBRARYx in the
X   process table (no need to put SWING.HLP in the system help file).
X
Xo  Added support for directories a la TOPS-10/20, e.g.: <FOOBAR>
X
Xo  Rather than keeping the save-file in the top-level current tree, SWING
X   now checks for a logical name SWING_SAVE and writes/reads save files there,
X   the name being toplevel_SWING.SAV, e.g.: when
X     SWING_SAVE = "D_3:[U3369429.SWING_SAVE]"
X   and I swing through U3364711 and save,
X   the file will be D_3:[U3369429.SWING_SAVE]U3364711_SWING.SAV
X
Xo  The menu bar selection works now in a circular manner. I.e., if the leftmost
X   menu is highlighted and you press "left arrow", it will highlight the right-
X   most menu, and vice versa.
X
Xo  SWING has not been tested at all with privileges higher than GROUP.
X
Xo  Implemented "Next/Previous Screen"
X
Xo  Removed calls to set_notab & reset_terminal
X
Xo  Added Mike Strasser's (STRASSER@RSBS0.ANU.au) ISADIR function so only true
X   directories will be shown. Mike had to put a lot of effort into this gem.
X   Thanks, Mike!
X
X
XNOTE:	Make sure that your site has the correct module in
X	SYS$LIBRARY:FORSYSDEF.TLB . You'll notice this when you get a few
X	hundred errors at compile time.
X	Another way to find out is:
X	Library/List/Only=$SMG* SYS$Library:FORSYSDEF.TLB
X	If it shows modules $SMGDEF and $SMGTRMPTR then you sould be ok,
X	if you see only $SMGDEF the library is most probably wrong. That module
X	is really $SMGTRMPTR and $SMGDEF has been lost.
X
X	If your library is faulty, you have to change the string "($smgdef)"
X	in all files where it occurs to "SMGDEF.TXT".
X
XVT220:	Your VT220 should be configured like this:
X	General Set_Up : "User Defined Keys Unlocked" and "Normal Cursor Keys"
$ Name=File'nF
$ Write SYS$Output "creating ",Name
$ Open/Write Out 'Name
$ Open/Read In VMS_SHAR_DUMMY.DUMMY
$Next_Record2: Read/End_Of_File=EOF2 In Record
$ Write Out F$Extract(1,255,Record)
$ Goto Next_Record2
$EOF2: Close Out
$ Close In
$ Delete VMS_SHAR_DUMMY.DUMMY;*
$ Checksum 'Name
$ Success=F$Element(Check_Sum'nF.eq.CHECKSUM$CHECKSUM,",",Pass_or_Failed)
$ Write SYS$ERROR "Checking CHECKSUM. ''Success'"
$ nF=nF+1
$ Copy SYS$Input VMS_SHAR_DUMMY.DUMMY
X!=======================================================================
X! THIS IS THE HELP LIBRARY FOR SWING
X!=======================================================================
X!
X! This is the help file for the program SWING
X! To add this to an existing help library, type:
X! $ LIBRARY your_help_library.HLB SWING.HLP
X!
X! Note that the processed version of this file (.HLB)
X! is used by the SWING executable and must be located in some HLP$LIBRARY
X!
X1 SWING
X SWING is a VAX/VMS utility for displaying the graphical representation
X of directory trees on a VT100 or VT200 type terminal. It can be used to
X move to a directory or subdirectory, as is done with the SET DEFAULT
X command, and it can rename, move and delete subdirectories. SWING can
X also create hardcopy listings of a directory structure. 
X
X Simply type SWING at the VMS prompt.
X2 Moving_around
X Once SWING has drawn a picture of the default directory structure the
X cursor will be positioned at the current directory and it will be
X highlighted. The arrow keys can be used to move from one subdirectory
X to another. As you travel around you are "setting default" to that
X directory. To exit simply type X, E, Q, RETURN, CONTROL-Z, F10
X and you will return to VMS in the new directory location. 
X 
X As you move around with the arrow keys notice that the RIGHT, UP and 
X DOWN arrows take you to the first directory available in that direction 
X and that the LEFT arrow takes you to the parent of the current directory.
X
X DEC terminal keys "Prev Screen" and "Next Screen" are also supported.
X 
X Other commands can be entered to create, rename and move subdirectories,
X as well as delete entire directory trees and get a hardcopy listing of
X the current directory structure. To get help on these various commands
X enter the section of help called COMMANDS. 
X2 Save_file
X Every time SWING displays a directory tree it gets its information from
X either searching the disk or from a save file.
X
X If the logical name SWING_SAVE is defined as a directory, this file
X will be called SWING_SAVE:(top_level)_SWING.SAV.
X If such logical name is not defined, the file name is
X [(top_level)]SWING_SAV
X
X If SWING is going to be used on a regular basis it is advisable
X that the structure be saved in such a file.
X
X The SAVE command will create a save file and from that point on SWING will
X attempt to keep that file up-to-date. Having the save file will speed
X up initialization so much that it might be tempting to use SWING for
X "setting default" all of the time. 
X 
X If the directory structure is changed in any way by SWING the save file
X will be updated automatically, but if a change has occured without the
X use of SWING it will be necessary to do a manual SAVE on the new
X directory tree.
X 
X NOTE: SWING does purge the save files provided the current process
X       has enough privilege.
X2 Commands
X Commands can be entered by either hitting the first letter of the
X commands located on the menu at the top of the screen or by hitting the
X CONTROL-P or DO keys and using the menu bar like a pulldown menu. The
X pulldown menu is operated by using the arrow keys to go to a selection
X and then hitting the ENTER key to choose that item. CONTROL-Z will exit
X the pulldown menu without making a choice. Although the pulldown menu is
X cute, hitting the first letter of the commands is by far a faster
X method. 
X3 Create
X CREATE prompts the user for the name of a new subdirectory to be created.
X The display will be updated and an actual directory is created. 
X3 Rename
X RENAME prompts for a new name to be given to the current directory. The 
X display may change since the directories are in alphabetical order.
X3 Move
X MOVE initiates the move operation by blinking the current subdirectory
X and then the user is asked to move to the a new parent directory. When
X either RETURN or ENTER is hit the move takes place. Both the new parent
X and the directory being moved can have other subdirectories attached to
X them as well. While moving to the new parent directory the operation
X can be canceled by hitting any key besides the arrow keys, ENTER and
X RETURN. 
X3 Delete
X DELETE causes the current directory and all subdirectories below it to 
X be deleted automatically. The user is asked to enter YES before any 
X delete operation takes place and the word YES must be spelled out 
X completely. The deletion starts at the lowest subdirectory in the tree 
X and works its way back to the current directory. As files are being 
X deleted from a subdirectory that node will blink on the screen. If the
X subdirectory is successfully deleted the node name will blank out, so you
X can watch the directory tree being deleted graphically. 
X
X IMPORTANT: IF A FILE DOES NOT HAVE DELETE ACCESS FOR THE USER, SWING 
X            WILL ATTEMPT TO CHANGE THE PROTECTION ON IT SO THAT IT CAN
X            DELETE THE FILE (GIVEN THE PRIVILEGE OF THE USER ONLY)
X
X If a particular subdirectory or file still can't be deleted then the
X deletion process will continue anyway, leaving the protected files. 
X A message will be given stating the problem.
X3 Print
X PRINT creates a file for printing that contains a hardcopy version of 
X the directory structure. One of two file types can be created. The 
X normal output is for any printer and the LQP input file is for running 
X through the LQP utility on a laser printer for a clean line drawn 
X representation of the directory tree. The file is called SWING.LIS and 
X it will be placed in the current directory.
X3 Save
X SAVE causes a new save file to be created in the main directory. The 
X save file is for speeding up the initialization of SWING. See the 
X section called SAVE_FILE on the level of help above this level.
X3 Option
X OPTION causes an optional full directory specification to be displayed 
X at the top of the screen. The directory name will be modified each time 
X the user moves to a new directory location.
X3 Exit
X EXIT causes the SWING to exit to the currently selected subdirectory or 
X directory. The keys E, X, Q, F10, CONTROL-Z, ENTER and RETURN exit SWING.