From:	CSBVAX::MRGATE!vtcf@ncsc.ARPA@SMTP 12-APR-1988 22:36
To:	ARISIA::EVERHART
Subj:	SWING 1 OF 13


Received: from ncsc.ARPA by KL.SRI.COM with TCP; Mon 11 Apr 88 08:12:07-PDT
Received: by ncsc.ARPA id AA02702; Mon, 11 Apr 88 10:08:31 CST
Date: Mon, 11 Apr 88 10:08:31 CST
From: vtcf@ncsc.ARPA (Williams)
Message-Id: <8804111608.AA02702@ncsc.ARPA>
To: info-vax@kl.sri.com
Subject: SWING 1 OF 13

....................... Cut between dotted lines and save ......................
$!.............................................................................
$! VAX/VMS archive file created by VMS_SHAR V-5.02 06-Oct-1987
$! which was written by Michael Bednarek (U3369429@ucsvc.dn.mu.oz.au)
$! To unpack, simply save and execute (@) this file.
$!
$! This archive was created by PERKINS (E.H. Perkins, Alberta Research Council, ORSD)
$! on Monday 28-MAR-1988 11:00:28.71
$!
$! ATTENTION: To keep each article below 15872 bytes, this program
$! has been transmitted in 13 parts.
$! You should concatenate ALL parts to ONE file and execute (@) that file.
$!
$! It contains the following 18 files:
$! AAA.README PULLDOWN.CMN SWING.CMN SWING.DOCUMENTATION SWING.HLB SWING.HLP
$! SWING_1.FOR SWING_10.FOR SWING_2.FOR SWING_3.FOR SWING_4.FOR SWING_5.FOR
$! SWING_6.FOR SWING_7.FOR SWING_8.FOR SWING_9.FOR SWING_BUILD.COM
$! SWING_TABLES.CLD
$!=============================================================================
$ Set Symbol/Scope=(NoLocal,NoGlobal)
$ Version=F$GetSYI("VERSION") ! See what VMS version we have here:
$ If Version.ges."V4.4" then goto Version_OK
$ Write SYS$Output "Sorry, you are running VMS ",Version, -
                ", but this procedure requires V4.4 or higher."
$ Exit 44
$Version_OK: CR[0,8]=13
$ Pass_or_Failed="failed!,passed."
$ Goto Start
$Convert_File:
$ Read/Time_Out=0/Error=No_Error1/Prompt="creating ''File_is'" SYS$Command ddd
$No_Error1: Define/User_Mode SYS$Output NL:
$ Edit/TPU/NoSection/NoDisplay/Command=SYS$Input/Output='File_is' -
        VMS_SHAR_DUMMY.DUMMY
f:=Get_Info(Command_Line,"File_Name");b:=Create_Buffer("",f);
o:=Get_Info(Command_Line,"Output_File");Set(Output_File,b,o);
Position(Beginning_of(b));Loop x:=Erase_Character(1);Loop ExitIf x<>"V";
Move_Vertical(1);x:=Erase_Character(1);Append_Line;
Move_Horizontal(-Current_Offset);EndLoop;Move_Vertical(1);
ExitIf Mark(None)=End_of(b) EndLoop;Position(Beginning_of(b));Loop
x:=Search("`",Forward,Exact);ExitIf x=0;Position(x);Erase_Character(1);
If Current_Character='`' then Move_Horizontal(1);else
Copy_Text(ASCII(INT(Erase_Character(3))));EndIf;EndLoop;Exit;
$ Delete VMS_SHAR_DUMMY.DUMMY;*
$ Checksum 'File_is
$ Success=F$Element(Check_Sum_is.eq.CHECKSUM$CHECKSUM,",",Pass_or_Failed)+CR
$ Read/Time_Out=0/Error=No_Error2/Prompt=" CHECKSUM ''Success'" SYS$Command ddd
$No_Error2: Return
$Start:
$ File_is="AAA.README"
$ Check_Sum_is=1394651816
$ Copy SYS$Input VMS_SHAR_DUMMY.DUMMY
XThis distribution of SWING is from Ernie Perkins, Alberta Research Council.
XPrevious users may note that the file naming convention is different
Xthan previous distributions.  As we use a limit of 31 blocks when sending
Xfiles over the net, some re-organization was necessary.
X
XTo the best of my knowledge, all posted fixes, bugs and improvements have
Xbeen included.  In the main program, they are almost all included in comments,
Xhowever, several minor changes have been ONLY noted in the code (sorry,
Xguys, I just slipped up).  The main routine is in SWING_1.for.
X
XThere is a command file to compile/make everything included. It does not
Xinstall any of the help files.  That's your problem.  If they are not
Xinstalled, SWING will blow out when you try to get help.
X
XTo use, define in your login file as follows (with your directory/disc)
Xor define in the system file.
X
X      $ swing:==`009`009"$users4:[perkins.swing_save]swing.exe"
X
XYou may also find it useful to define swing_save (the directory where 
Xthe users swing_file lives.....) the users login file 
X
X$ define/nolog swing_save`009"USERS4:[perkins.swing_save]"
X
XA definition for swing$print (how swing interprets the print command 
X.... note that my command here is totally non-standard)
X
X$ define/nolog swing$print`009"nprint/dev=lpoil/landscape" 
X
XAnd if you edit a file, swing$edit should be set to the editor of
Xyour hearts desire. 
X
X$ define/nolog swing$edit`009"edit/tpu"
X
X
X
XEnjoy, and remember to thank the author and the many people who have
Xprovided fixes in your prayers.....
X 
XErnie        March, 1988
X
XP.S. I take no responsiblity for the use/mis-use of this program,
X     but sure do find it useful.
X
XEHP
$ GoSub Convert_File
$ File_is="PULLDOWN.CMN"
$ Check_Sum_is=962856556
$ Copy SYS$Input VMS_SHAR_DUMMY.DUMMY
X*=======================================================================
X*     COMMONS FOR PULLDOWN.FOR
X*=======================================================================
X
XC     CONSTRAINTS
X
X      parameter PD_MAX_CHOICES = 10
X      parameter PD_MAX_CHOICE_LEN = 20
X
XC     THE PULL DOWN CHOICE STRUCTURE
X
X      structure /pd_choice_type/
X         integer number
X         character*(PD_MAX_CHOICE_LEN) choice(PD_MAX_CHOICES)
X         integer code(PD_MAX_CHOICES)
X         integer ptr(PD_MAX_CHOICES)
X      end structure
X
XC     PULL DOWN SCREEN INFORMATION
X
X      integer pd_bar_id, pd_num_choices, pd_cell_size
X
X      common /pd_common/ pd_bar_id,      ! BAR DISPLAY ID
X     .                   pd_num_choices, ! NUMBER OF POSSIBLE CHOICES
X     .                   pd_cell_size    ! LENGTH OF EACH CELL IN THE BAR
$ GoSub Convert_File
$ File_is="SWING.CMN"
$ Check_Sum_is=2138131441
$ Copy SYS$Input VMS_SHAR_DUMMY.DUMMY
X*=======================================================================
X*     COMMONS FOR SWING.FOR
X*=======================================================================
X
X      implicit  none
X
X      include 'pulldown.cmn'
X
X      parameter MAX_LINES = 495  ! Bug in SMG prevents > 496
X      parameter MAX_LEVELS = 7
X      parameter MAX_NODES = 3500
X      parameter MAX_FILES = 500
X
X      integer*4 line
X      integer   last_level, last_line(0:MAX_LEVELS)
X      integer   last_node(0:MAX_LEVELS)
X      integer   node_pointer( 0:MAX_LEVELS, MAX_LINES ), lowest_level
X      integer   node_num, num_nodes, num_lines, file_num, num_files
X
X      structure /node_type/
X                character*255 spec
X                character*12  name
X                integer*4     length
X                integer*4     level
X                integer*4     line  
X                integer*4     rend
X                integer*4     child
X                integer*4     sister
X      end structure
X
X      record /node_type/ node(0:MAX_NODES)
X
X      structure /fnode_type/
X                character*255 spec
X                character*25  name
X                integer*4     length
X                integer*4     rend
X      end structure
X
X      record /fnode_type/ fnode(MAX_FILES)
X
X      common /node_info/ line,
X     .                   last_level,
X     .                   lowest_level,
X     .                   last_line,
X     .                   last_node,
X     .                   num_lines,
X     .                   node_pointer,
X     .                   node,
X     .                   node_num,
X     .                   num_nodes,
X     .                   fnode,
X     .                   file_num,
X     .                   num_files
X
X      integer   window1, window2, window3, board_id, set_term_buf(3)
X      integer   width, cur_level, cur_line, bottom_line, top_line
X      integer   old_rend, len_disk, len_main, len_root, keyboard
X      integer   file_window, top_file_line, bottom_file_line
X      integer   DCL_window, proc_created
X      integer*2 inbox_channel, outbox_channel
X      logical   avo, using_screen, found, update, delete_problem
X      logical   use_window1, do_save, swing_file_exists
X      character this_terminal*31, disk*31, root*255, main*100
X
X      record /pd_choice_type/ pull_choices
X
X      common /smg_info/  board_id,
X     .                   keyboard,
X     .                   window1,
X     .                   window2,
X     .                   window3,
X     .                   file_window,
X     .                   DCL_window,
X     .                   pull_choices,
X     .                   this_terminal,
X     .                   set_term_buf,
X     .                   width,
X     .                   avo,
X     .                   old_rend,
X     .                   disk,
X     .                   len_disk,
X     .                   root,
X     .                   len_root,
X     .                   main,
X     .                   len_main,
X     .                   cur_level,
X     .                   cur_line,
X     .                   top_line,
X     .                   bottom_line,
X     .                   top_file_line,
X     .                   bottom_file_line,
X     .                   using_screen,
X     .                   use_window1,
X     .                   update,
X     .                   found,
X     .                   delete_problem,
X     .                   do_save,
X     .                   swing_file_exists,
X     .                   inbox_channel,
X     .                   outbox_channel,
X     .                   proc_created
$ GoSub Convert_File
$ File_is="SWING.DOCUMENTATION"
$ Check_Sum_is=2052982748
$ Copy SYS$Input VMS_SHAR_DUMMY.DUMMY
X
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      o  Perform file-manipulation on the files in the current directory
X         with the FILER option.
X
X      o  Execute DCL commands with out leaving the SWING environment.
X
X      New Features:
X
X        FILER under the OPTION command - allows you to do individual
X              file operations. E.g. Edit, Print, Rename, Delete, Move, etc.
X
X              the logical name SWING$EDIT if defined will be the command
X              used to invoke the editor. TPU is the default, if you
X              defined TPUSECINI to be USR:EDTPLUS you will be using the
X              same TPU.
X
X              the logical name SWING$PRINT, if defined, will be the command
X              used to print the file, for example, you can define it
X              to be NPRINT/DEV=LPOIL/LANDSCAPE 
X
X        DCL commands under the OPTION command - allows you to do some
X              DCL commands (non-interactively, for example, you can not
X              invoke the editor, read mail or use phone, but this can be
X              achieved from the SPAWN out of TPU)
X
X
X        T for top, and B for bottom commands allow you to go to the bottom
X              of you directory tree quickly, and back to TOP.
X
X       /START qualifier is added so you can start swing from a subdirectory.
X
X       If you use Dale Coys version of SD, the directory stack is
X       automatically updated.
X
X      old info follows,
X
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------------------------------------------------------------------------
XTHE FILES              THEIR USE
X------------------------------------------------------------------------
XAAA.README           This file
XSWING_BUILD.COM      Command procedure to compile source
XPULLDOWN.CMN         Commons for PULLDOWN.FOR
XSWING_BUILD.COOM     Com file to rebuild swing
XSWING.CMN            Commons for SWING.FOR
XSWING.HLB            SWING help library
XSWING.HLP            SWING help source
XSWING_TABLES.CLD     Information to define SWING as a foreign command
XSWING_1.for          Part 1 of the swing source
XSWING_2.for          Part 2 of the swing source
XSWING_3.for          Part 3 of the swing source
XSWING_4.for          Part 4 of the swing source
X
X------------------------------------------------------------------------
X                            INSTALLATION
X
X
X$ ! Set up a symbol like this in your sylogin.com or login.com
X$ ! where ?? points to the copy of swing on your system.  
X$ !
X$ SWING:== ??:SWING
X$ ! Currently on titan, use the symbol def
X$ !   swing:== "$users4:[perkins.swing_save]swing.exe"
X
X$ ! Add the help library to helplib
X$ ! This requires privilege
X$ !
X$ LIBRARY/HELP SYS$HELP:HELPLIB SWING.HLP
X
X$ ! Put the SWING help library in SYS$HELP for interactive help in SWING
X$ ! This requires privilege
X$ !
X$ LIBRARY/HELP/CREATE SYS$HELP:SWING SWING.HLP
X
X$  If you need to rebuild swing for any reason, use the 
X$  command file  @swing_build.com
$ GoSub Convert_File
$ Goto Part02
