 FTN4 
C                                                 <800822.0800> 
C 
C 
C  ***************************************************************
C  * (C) COPYRIGHT HEWLETT-PACKARD COMPANY 1980.  ALL RIGHTS     *
C  * RESERVED.  NO PART OF THIS PROGRAM MAY BE PHOTOCOPIED,      *
C  * REPRODUCED OR TRANSLATED TO ANOTHER PROGRAM LANGUAGE WITHOUT*
C  * THE PRIOR WRITTEN CONSENT OF HEWLETT-PACKARD COMPANY.       *
C  ***************************************************************
C 
C 
C           NAME:   EDTU3 
C           SOURCE: 92074-18010 
C           RELOC:  PART OF 92074-12002 
C           PGMR:   J.D.J.
C 
C 
C     HELP SEGMENT FOR EDIT 
C 
C     JOHN JOHNSON
C     7/09/80 
C 
      SUBROUTINE EHELP,92074-1X010 REV.2034 800818
      IMPLICIT INTEGER(A-Z) 
      LOGICAL KEYT,KEYFG
      COMMON  /KEYFG/ KEYFG 
C set key found flag false
      KEYFG = .FALSE.       
      IF(.NOT.( KEYT(2H  ) .OR.KEYT(2HLP) ))GOTO 23000
C ONLY '?' GIVEN  OR 'HE''LP' 
      CALL EHMSG(70H------------------commands--------------------------
     *-   --line specs--,-70) 
      CALL EHMSG(69HA  abort          KB kill blanks     SZ file size   
     *    n line number,-69)
      CALL EHMSG(68HB  top & find     L  list            T  tabs        
     *    + forward n ,-68) 
      CALL EHMSG(68HC  p then +1      LE line length     TI time        
     *    - backward n,-68) 
      CALL EHMSG(68HCO copy lines     LI lines in file   TR transfer    
     *    ^ backward n,-68) 
      CALL EHMSG(70HD  del. to match  M  merge           U  uncond. X   
     *    . current line,-70) 
      CALL EHMSG(69HEC create,exit    MO move            UN undo        
     *    * line spec 1,-69)
      CALL EHMSG(67HER replace,exit   N  line number     W  list a windo
     *w   $ last line,-67)
      CALL EHMSG(67HF  find           O  copy pl         WC write, creat
     *e   > last line,-67)
      CALL EHMSG(70HFC file close     P  edit pl         WR write, repla
     *ce  ' forward find,-70) 
      CALL EHMSG(71HFI file input     Q  line edit       X  exchange    
     *    ` backward find,-71)
      CALL EHMSG(48HG  no list X      R  replace line    Y  X then F,-48
     *) 
      CALL EHMSG(71HH  help           RU run program     #  sequence    
     *    -special chars-,-71)
      CALL EHMSG(68HHL header line    S  screen edit     ?  help        
     *    @ indefinite,-68) 
      CALL EHMSG(64HI  insert line    SC screen copy     /  command stac
     *k   ^ anchor,-64) 
      CALL EHMSG(64HJ  join lines     SE set options     <space>        
     *    \ escape,-64) 
      CALL EHMSG(65HK  kill lines     SH show options       append line 
     *    | command,-65)
      CALL EHMSG(68H                                                    
     *       separator,-68) 
      CALL EHMSG(45H   ?,command for information about a command ,-45)
      CALL EHMSG(71H   ?,EX  abbreviation explanation        ?,PA find p
     *attern information ,-71)
      CALL EHMSG(65H   ?,RE  regular expression information  ?,PL pendin
     *g line edits ,-65)
      CALL EHMSG(29H   ?,LS  line specifications.,-29)
23000 CONTINUE
      IF(.NOT.(KEYT(2HEX)))GOTO 23002 
      CALL EHMSG(14HAbbreviations:,-14) 
      CALL EHMSG(64H OK? - Some commands ask before excution by promptin
     *g with this.,-64) 
      CALL EHMSG(65H       Asking may be suppressed by terminating a com
     *mand with the,-65)
      CALL EHMSG(32H       current prompt character.,-32) 
      CALL EHMSG(1H ,-1)
      CALL EHMSG(69H [xx] implies an optional parameter, the default val
     *ue is give inside,-69)
      CALL EHMSG(14H the brackets.,-14) 
      CALL EHMSG(1H ,-1)
      CALL EHMSG(68H   Q       - Quiet.  An option on some commands to s
     *uppress listing.,-68) 
      CALL EHMSG(69H   A       - All.  An option on B, F, and D to match
     * all occurrences.,-69)
      CALL EHMSG(65H   V       - Reverse.  Reverse the match sense for f
     *ind commands.,-65)
      CALL EHMSG(71H   N       - No window. Allows match anywhere on a l
     *ine for B, F, D, X.,-71)
      CALL EHMSG(63H   S       - Single.  Permits at most one exchange f
     *or X and Y.,-63)
      CALL EHMSG(54H   cntl    - The CNTL version of the following lette
     *r.,-54) 
      CALL EHMSG(40H * pattern - Pattern to be searched for.,-40) 
      CALL EHMSG(46H   n       - Positive integer less than 32768.,-46) 
      CALL EHMSG(60H   namr    - File name[:security[:cartridge[:type[:s
     *ize]]]].,-60) 
      CALL EHMSG(33H * re      - Regular expressions.,-33)
      CALL EHMSG(64H * pl edit - Pending line edit using special control
     * characters.,-64) 
      CALL EHMSG(50HAdditional help is available on the starred items.,-
     *50) 
      CALL EHMSG(1H ,-1)
      CALL EHMSG(59HSpaces or a comma may be used as a delimiter when pa
     *rameter,-59)
      CALL EHMSG(67Hseparation in ambiguous.  Two commas together specif
     *ies the default,-67)
      CALL EHMSG(37Hvalue for a parameter should be used.,-37)
23002 CONTINUE
      IF(.NOT.(KEYT(2HPA).OR.KEYT(1H@) ))GOTO 23004 
      CALL EHMSG(8HPatterns,-8) 
      CALL EHMSG(54H The string of characters to be found during a searc
     *h.,-54) 
      CALL EHMSG(65H Normal patterns are described here, see ?,RE for he
     *lp on regular,-65)
      CALL EHMSG(68H expressions.  Patterns start and stop with a delimi
     *ter which may be,-68) 
      CALL EHMSG(66H any punctuation character except comma or space.  I
     *f the field is,-66) 
      CALL EHMSG(68H started with a '^' then the search is anchored to  
     *the start of the,-68) 
      CALL EHMSG(65H window; otherwise the match may occur anywhere with
     *in the window,-65)
      CALL EHMSG(67H columns.  The window always applies to line specifi
     *cation searchs.,-67)
      CALL EHMSG(70H It may be turned off with the N option on find and 
     *exchange commands.,-70) 
      CALL EHMSG(59H A '@' character anywhere in the pattern means zero 
     *or more,-59)
      CALL EHMSG(56H characters may be skipped during matching on this l
     *ine,,-56) 
      CALL EHMSG(61H and the shortest possible match is used for non-RE 
     *matching.,-61)
      CALL EHMSG(59H A "\" is the escape character, it is not part of th
     *e match,-59)
      CALL EHMSG(65H but instead removes any special meaning from the ne
     *xt character.,-65)
      CALL EHMSG(51H Use '\@' or '\\' to find  '@' or '\' respectively.,
     *-51)
23004 CONTINUE
      IF(.NOT.( KEYT(2HPL)))GOTO 23006
      CALL EHMSG(61HPL Edit - Pending line edit using special control ch
     *aracters.,-61)
      CALL EHMSG(63H  The string entered after the command character des
     *cribes what,-63)
      CALL EHMSG(63H  changes to make to the pending line. Special chara
     *cters are :,-63)
      CALL EHMSG(1H ,-1)
      CALL EHMSG(44H   cntl B  - Break the line at this position,-44) 
      CALL EHMSG(30H   cntl C  - Delete characters,-30) 
      CALL EHMSG(31H   cntl R  - Replace characters,-31)
      CALL EHMSG(29H   cntl S  - Insert character,-29)
      CALL EHMSG(26H   cntl T  - Truncate line,-26) 
      CALL EHMSG(24H   cntl X  - Extend line,-24) 
      CALL EHMSG(1H ,-1)
      CALL EHMSG(70H   / (current prompt) - Leave the character in this 
     *position unchanged,-70) 
      CALL EHMSG(1H ,-1)
      CALL EHMSG(10H Example: ,-10) 
      CALL EHMSG(1H ,-1)
      CALL EHMSG(23H   This is the old line,-23)
      CALL EHMSG(43H /P////////<cntl C>XXX<cntl S>a<cntl R>/new,-43)
      CALL EHMSG(21H   This is a new line,-21)
23006 CONTINUE
      IF(.NOT.( KEYT(2HRE)))GOTO 23008
      CALL EHMSG(55HRegular Expression  - A class of string specificatio
     *ns.,-55)
      CALL EHMSG(11H Examples :,-11)
      CALL EHMSG(61H To change the word IN to INPUT but not LINE to LINP
     *UTE use :,-61)
      CALL EHMSG(20H       X/:IN:/INPUT/,-20) 
      CALL EHMSG(69H To change  'getc(xxx)' to 'getch(xxx,file)' where x
     *xx can vary use :,-69)
      CALL EHMSG(38H       X/getc({[^)]*})/getch(&1,file)/,-38) 
      CALL EHMSG(67H Note that this will not work if xxx contains a righ
     *t parenthesis. ,-67)
      CALL EHMSG(1H ,-1)
      CALL EHMSG(57H Regular expressions are enabled with a SE RE ON com
     *mand.,-57)
      CALL EHMSG(1H ,-1)
      CALL EHMSG(55H Metacharacters are used to denote special field typ
     *es.,-55)
      CALL EHMSG(64H Any character can be reverted (escaped) to itself b
     *y preceding ,-64) 
      CALL EHMSG(42H it with a "\".  The metacharacters are : ,-42) 
      CALL EHMSG(1H ,-1)
      CALL EHMSG(48H  .       any character except the end of a line,-48
     *) 
      CALL EHMSG(40H  ^       beginning of the window (line),-40) 
      CALL EHMSG(57H  $       end of the line or window, whichever is sh
     *orter,-57)
      CALL EHMSG(55H  [xyz]   character class (any one of these characte
     *rs),-55)
      CALL EHMSG(60H  [^wxy]  negated character class (all but these cha
     *racters),-60) 
      CALL EHMSG(68H  *       closure (zero or more occurrences of the p
     *revious pattern),-68) 
      CALL EHMSG(54H  +       transitive closure (one or more occurrence
     *s),-54) 
      CALL EHMSG(41H  <n>     repeat previous pattern n times,-41)
      CALL EHMSG(56H  @       indefinite character match (shorthand for 
     * .*),-56) 
      CALL EHMSG(63H  :       transition between alphanumerics and other
     * characters,-63)
      CALL EHMSG(68H  {xyz}   tagged field to be recalled by &n in the s
     *ubstitute string,-68) 
      CALL EHMSG(63H  &n      n'th tagged field; used only in the substi
     *tute string,-63)
      CALL EHMSG(60H          (1 <= n <= 9; '&' by itself is the matched
     * field ),-60) 
      CALL EHMSG(62H  >n      same as &n but shift substitute string to 
     *upper case,-62) 
      CALL EHMSG(62H  <n      same as &n but shift substitute string to 
     *lower case,-62) 
      CALL EHMSG(1H ,-1)
      CALL EHMSG(68H A dash between alphanumerics in a character class s
     *pecifies a range,-68) 
      CALL EHMSG(70H such as [0-9],[A-Z], or [A-Z0-9].  Character classe
     *s may also include,-70) 
      CALL EHMSG(68H escaped characters such as [\^\\] which means the c
     *lass [ ^ or \ ].,-68) 
      CALL EHMSG(47H Closures extend to the longest possible match.,-47)
23008 CONTINUE
      IF(.NOT.( KEYT(2HLS).OR.KEYT(1H+).OR.KEYT(1H-).OR.KEYT(1H.).OR.KEY
     *T(1H*).OR.     KEYT(1H$).OR.KEYT(1H>).OR.KEYT(23440B).OR.KEYT(6004
     *0B) ))GOTO 23010
      CALL EHMSG(20HLine specifications.,-20) 
      CALL EHMSG(66H Many of the commands have optional line specificati
     *on in front of,-66) 
      CALL EHMSG(67H them. These may be the absolute line numbers or one
     * of the special,-67)
      CALL EHMSG(68H characters. They may also have + or - offsets. For 
     *example to list ,-68) 
      CALL EHMSG(62H the last 20 lines in a file use (the slash is Edit'
     *s prompt):,-62) 
      CALL EHMSG(1H ,-1)
      CALL EHMSG(10H   /$-19 l,-10) 
      CALL EHMSG(1H ,-1)
      CALL EHMSG(25H Special characters are :,-25)
      CALL EHMSG(1H ,-1)
      CALL EHMSG(18H   .  current line,-18) 
      CALL EHMSG(15H   $  last line,-15)
      CALL EHMSG(15H   >  same as $,-15)
      CALL EHMSG(39H   -  backward relative to current line,-39)
      CALL EHMSG(39H   ^  backward relative to current line,-39)
      CALL EHMSG(38H   +  forward relative to current line,-38) 
      CALL EHMSG(71H   *  line number of the first line spec. Legal only
     * in the second spec,-71)
      CALL EHMSG(48H   'pattern'      search forward for the pattern,-48
     *) 
      CALL EHMSG(49H   `pattern`      search backward for the pattern,-4
     *9)
      CALL EHMSG(1H ,-1)
      CALL EHMSG(68H If a null search pattern is given ( ''  or  `` ) it
     * defaults to the,-68) 
      CALL EHMSG(71H F command pattern.  If a pattern is given it become
     *s the next default.,-71)
23010 CONTINUE
      IF(.NOT.( KEYT(1H^)))GOTO 23012 
      CALL EHMSG(1H^,-1)
      CALL EHMSG(54H In line specifications '^' is backwards n.  See ?,L
     *S.,-54) 
      CALL EHMSG(67H In patterns '^' is the default anchor character. Se
     *e ?,PA or ?,RE.,-67)
23012 CONTINUE
      IF(.NOT.( KEYT(1H\)))GOTO 23014 
      CALL EHMSG(1H\,-1)
      CALL EHMSG(65H Default escape character.  When the escape characte
     *r is found in,-65)
      CALL EHMSG(67H a command it is removed and next character has no s
     *pecial meaning.,-67)
23014 CONTINUE
      IF(.NOT.( KEYT(1H|)))GOTO 23016 
      CALL EHMSG(1H|,-1)
      CALL EHMSG(64H Multiple commands may be placed on a line or in the
     * run string,,-64) 
      CALL EHMSG(65H delimited by the vertical bar "|" ( Ex. RU,EDIT, fi
     *le ,tp|ts|s).,-65)
23016 CONTINUE
      IF(.NOT.( KEYT(1HA)))GOTO 23018 
      CALL EHMSG(1HA,-1)
      CALL EHMSG(7H Abort.,-7)
23018 CONTINUE
      IF(.NOT.( KEYT(1HB)))GOTO 23020 
      CALL EHMSG(31H[1][$] B /pattern/ [A][V][Q][N],-31)
      CALL EHMSG(29H Find from beginning of file.,-29)
23020 CONTINUE
      IF(.NOT.( KEYT(1HC)))GOTO 23022 
      CALL EHMSG(5HCtext,-5)
      CALL EHMSG(54H Perform pl edit on current line then go to next lin
     *e.,-54) 
23022 CONTINUE
      IF(.NOT.( KEYT(2HCO)))GOTO 23024
      CALL EHMSG(14H l1 [*] CO [Q],-14) 
      CALL EHMSG(44H  Copy lines in range to after current line.,-44) 
23024 CONTINUE
      IF(.NOT.( KEYT(1HD)))GOTO 23026 
      CALL EHMSG(33H[.+1][$] D /pattern/ [A][V][Q][N],-33)
      CALL EHMSG(32H Delete until pattern is found. ,-32) 
      CALL EHMSG(72H If the first line spec is not given then always del
     *ete the current line,-72) 
      CALL EHMSG(45H regardless of pattern match on current line.,-45)
23026 CONTINUE
      IF(.NOT.( KEYT(2HEC)))GOTO 23028
      CALL EHMSG(7HEC namr,-7)
      CALL EHMSG(22H Create file and exit.,-22) 
23028 CONTINUE
      IF(.NOT.( KEYT(2HER)))GOTO 23030
      CALL EHMSG(10HER [namr] ,-10) 
      CALL EHMSG(23H Replace file and exit.,-23)
23030 CONTINUE
      IF(.NOT.( KEYT(2HWC)))GOTO 23032
      CALL EHMSG(7HWC namr,-7)
      CALL EHMSG(42H Create new file and remain in the editor.,-42) 
23032 CONTINUE
      IF(.NOT.( KEYT(2HWR)))GOTO 23034
      CALL EHMSG(9HWR [namr],-9)
      CALL EHMSG(58H Write file, remain in editor. Source file is the de
     *fault.,-58) 
      CALL EHMSG(48H If a namr is given the file must already exist.,-48
     *) 
23034 CONTINUE
      IF(.NOT.( KEYT(1HF)))GOTO 23036 
      CALL EHMSG(33H[.+1][$] F /pattern/ [A][V][Q][N],-33)
      CALL EHMSG(33H Find pattern in specified range.,-33)
23036 CONTINUE
      IF(.NOT.( KEYT(2HFC)))GOTO 23038
      CALL EHMSG(3HFCL,-3)
      CALL EHMSG(68H Close list file.  The list file is opened when a fi
     *le name is given,-68) 
      CALL EHMSG(71H as the optional namr in the L or K command.  If it 
     *is open a plus sign,-71)
      CALL EHMSG(61H can be used in place of the namr to append to the o
     *pen file.,-61)
      CALL EHMSG(1H ,-1)
      CALL EHMSG(3HFCS,-3)
      CALL EHMSG(53H Close source file.  Original file remains unchanged
     *.,-53)
      CALL EHMSG(53H This command removes the default file for ER and WR
     *.,-53)
23038 CONTINUE
      IF(.NOT.( KEYT(2HFI)))GOTO 23040
      CALL EHMSG(7HFI namr,-7)
      CALL EHMSG(65H File input.  This command deletes all lines in curr
     *ent workspace,-65)
      CALL EHMSG(59H then reads in a new file.  The ER and WR defualts a
     *re set.,-59)
23040 CONTINUE
      IF(.NOT.(KEYT(1HG)))GOTO 23042
      CALL EHMSG(38H[.][*] G/pattern/substitute/ [N][R][S],-38) 
      CALL EHMSG(19H X without listing.,-19)
23042 CONTINUE
      IF(.NOT.(KEYT(2HH ) .OR.KEYT(2HHE) .OR. KEYT(1H?)))GOTO 23044 
      CALL EHMSG(27HH [command] or  ? [command],-27)
      CALL EHMSG(64H Give help about commands.  HE,ALL  will list all he
     *lp messages.,-64) 
23044 CONTINUE
      IF(.NOT.( KEYT(2HHL)))GOTO 23046
      CALL EHMSG(2HHL,-2) 
      CALL EHMSG(12H Ruler line.,-12) 
23046 CONTINUE
      IF(.NOT.( KEYT(1HI)))GOTO 23048 
      CALL EHMSG(9H[.] Itext,-9)
      CALL EHMSG(33H Insert text before current line.,-33)
23048 CONTINUE
      IF(.NOT.( KEYT(1HJ)))GOTO 23050 
      CALL EHMSG(5H[.] J,-5)
      CALL EHMSG(34H  Join current line and next line.,-34) 
23050 CONTINUE
      IF(.NOT.( KEYT(1HK)))GOTO 23052 
      CALL EHMSG(29H[.][$]K [max] [+] [list namr],-29)
      CALL EHMSG(63H Kill (delete) lines in range but do not delete more
     * lines than,-63)
      CALL EHMSG(59H the max spec. Default max is one if range is not sp
     *ecified,-59)
      CALL EHMSG(64H otherwise it is the entire range. If the list namr 
     *is specified,-64) 
      CALL EHMSG(63H the deleted lines are copied to it.  When it is giv
     *en the max ,-63)
      CALL EHMSG(66H can be given or 'K,,list namr' can be used. A plus 
     *sign ( + )  in,-66) 
      CALL EHMSG(65H front of the list namr means append to this file.  
     *The list file,-65)
      CALL EHMSG(64H is left open and can be appended to by just giving 
     *a plus sign.,-64) 
      CALL EHMSG(30H FCL will close the list file.,-30) 
23052 CONTINUE
      IF(.NOT.( KEYT(2HKB)))GOTO 23054
      CALL EHMSG(2HKB,-2) 
      CALL EHMSG(22H Kill trailing blanks.,-22) 
23054 CONTINUE
      IF(.NOT.(KEYT(1HL) .OR. KEYT(2HLU) .OR. KEYT(2HLN) ))GOTO 23056 
      CALL EHMSG(30H[.][$] L [max] [+] [list namr],-30) 
      CALL EHMSG(57H List lines in range but do not list more lines than
     * max.,-57)
      CALL EHMSG(64H Default max is 20 lines.  If a list namr is specifi
     *ed then max ,-64) 
      CALL EHMSG(66H can be given or 'L,,list namr' can be used. A plus 
     *sign ( + )  in,-66) 
      CALL EHMSG(65H front of the list namr means append to this file.  
     *The list file,-65)
      CALL EHMSG(64H is left open and can be appended to by just giving 
     *a plus sign.,-64) 
      CALL EHMSG(30H FCL will close the list file.,-30) 
      CALL EHMSG(1H ,-1)
      CALL EHMSG(2HLN,-2) 
      CALL EHMSG(70H Numbered list.  Same as L but turn on numbers.  Num
     *bers stay on until,-70) 
      CALL EHMSG(14H a LU command.,-14) 
      CALL EHMSG(1H ,-1)
      CALL EHMSG(2HLU,-2) 
      CALL EHMSG(74H Unnumbered list.  Same as L but turn off numbers.  
     *Numbers stay off until,-74) 
      CALL EHMSG(14H a LN command.,-14) 
23056 CONTINUE
      IF(.NOT.( KEYT(2HLE)))GOTO 23058
      CALL EHMSG(6H[.] LE,-6) 
      CALL EHMSG(38H Length of current line in characters.,-38) 
23058 CONTINUE
      IF(.NOT.( KEYT(2HLI)))GOTO 23060
      CALL EHMSG(2HLI,-2) 
      CALL EHMSG(29H Number of lines in the file.,-29)
23060 CONTINUE
      IF(.NOT.( KEYT(1HM)))GOTO 23062 
      CALL EHMSG(6HM namr,-6) 
      CALL EHMSG(60H Merge file into work area. Merge starts after curre
     *nt line.,-60) 
23062 CONTINUE
      RETURN
      END 
      SUBROUTINE EHMSG(MESS,L),92074-1X010 REV.2034 800818
      INTEGER MESS(L) 
      COMMON /LSTLU/ LSTLU
      COMMON/KEY/ KEY 
      CALL EXEC(100002B,LSTLU,3H  _,-3) 
96    GOTO 100
97    CALL EXEC(100002B,LSTLU,MESS,L) 
98    GOTO 100
99    CONTINUE
      IF(.NOT.(  IFBRK(JUNK) .NE. 0 ))GOTO 23064
      KEY = 0 
23064 CONTINUE
      RETURN
100   KEY = 0 
      RETURN
      END 
      LOGICAL FUNCTION keyt(TEST),92074-1X010 REV.2034 800818 
      INTEGER TEST
      LOGICAL KEYFG 
      COMMON /KEYFG/ KEYFG
      COMMON /KEY/ KEY
      IF(.NOT.( KEY .EQ. 2HAL))GOTO 23066 
      CALL EHMSG(1H ,-1)
      CALL EHMSG(1H ,-1)
23066 CONTINUE
      KEYT = ( (TEST .EQ. KEY) .OR. (KEY .EQ. 2HAL))
      IF(.NOT.(KEYT))GOTO 23068 
      KEYFG = .TRUE.
23068 CONTINUE
      END 
      END$
C                                                 <800822.0800> 
C 
C 
C  ***************************************************************
C  * (C) COPYRIGHT HEWLETT-PACKARD COMPANY 1980.  ALL RIGHTS     *
C  * RESERVED.  NO PART OF THIS PROGRAM MAY BE PHOTOCOPIED,      *
C  * REPRODUCED OR TRANSLATED TO ANOTHER PROGRAM LANGUAGE WITHOUT*
C  * THE PRIOR WRITTEN CONSENT OF HEWLETT-PACKARD COMPANY.       *
C  ***************************************************************
C 
C 
C           NAME:   EDTU3 
C           SOURCE: 92074-18010 
C           RELOC:  PART OF 92074-12002 
C           PGMR:   J.D.J.
C 
C 
#     HELP SEGMENT FOR EDIT 
# 
#     JOHN JOHNSON
#     7/09/80 
# 
"      SUBROUTINE EHELP,92074-1X010 REV.2034 800818"
  
      IMPLICIT INTEGER(A-Z) 
  
      LOGICAL KEYT,KEYFG
      COMMON  /KEYFG/ KEYFG 
  
  
DEFINE(KEYTEST,[* 
         IF( KEYT($1)) [ *])
DEFINE(MS,[*CALL EHMSG($1,-QLENGTH)*])
  
       keyfg = .false.      # set key found flag false
  
  
      IF( KEYT('  ') \KEYT('LP') ) [ # ONLY '?' GIVEN  OR 'HE''LP'
MS('------------------commands---------------------------   --line specs--')  
MS('A  abort          KB kill blanks     SZ file size       n line number') 
MS('B  top & find     L  list            T  tabs            + forward n ')
MS('C  p then +1      LE line length     TI time            - backward n')
MS('CO copy lines     LI lines in file   TR transfer        ^ backward n')
MS('D  del. to match  M  merge           U  uncond. X       . current line')
MS('EC create,exit    MO move            UN undo            * line spec 1') 
MS('ER replace,exit   N  line number     W  list a window   $ last line') 
MS('F  find           O  copy pl         WC write, create   > last line') 
MS("FC file close     P  edit pl         WR write, replace  ' forward find")
MS("FI file input     Q  line edit       X  exchange        ` backward find") 
MS('G  no list X      R  replace line    Y  X then F')
MS('H  help           RU run program     #  sequence        -special chars-') 
MS('HL header line    S  screen edit     ?  help            @ indefinite')
MS('I  insert line    SC screen copy     /  command stack   ^ anchor')
MS('J  join lines     SE set options     <space>            \ escape')
MS('K  kill lines     SH show options       append line     | command') 
MS('                                                           separator')
MS('   ?,command for information about a command ') 
MS('   ?,EX  abbreviation explanation        ?,PA find pattern information ') 
MS('   ?,RE  regular expression information  ?,PL pending line edits ') 
MS('   ?,LS  line specifications.') 
 ]
  
  
 IF(KEYT('EX'))  [
MS('Abbreviations:')
MS(' OK? - Some commands ask before excution by prompting with this.')
MS('       Asking may be suppressed by terminating a command with the') 
MS('       current prompt character.')
MS(' ') 
MS(' [xx] implies an optional parameter, the default value is give inside') 
MS(' the brackets.')
MS(' ') 
MS('   Q       - Quiet.  An option on some commands to suppress listing.')
MS('   A       - All.  An option on B, F, and D to match all occurrences.') 
MS('   V       - Reverse.  Reverse the match sense for find commands.') 
MS('   N       - No window. Allows match anywhere on a line for B, F, D, X.') 
MS('   S       - Single.  Permits at most one exchange for X and Y.') 
MS('   cntl    - The CNTL version of the following letter.')
MS(' * pattern - Pattern to be searched for.')
MS('   n       - Positive integer less than 32768.')
MS('   namr    - File name[:security[:cartridge[:type[:size]]]].')
MS(' * re      - Regular expressions.') 
MS(' * pl edit - Pending line edit using special control characters.')
MS('Additional help is available on the starred items.')
MS(' ') 
MS('Spaces or a comma may be used as a delimiter when parameter') 
MS('separation in ambiguous.  Two commas together specifies the default') 
MS('value for a parameter should be used.') 
  
] 
  
if(keyt('PA')\keyt('@') ) [ 
MS('Patterns')
MS(' The string of characters to be found during a search.')
MS(' Normal patterns are described here, see ?,RE for help on regular') 
MS(' expressions.  Patterns start and stop with a delimiter which may be')
MS(' any punctuation character except comma or space.  If the field is')      
MS(" started with a '^' then the search is anchored to  the start of the")    
MS(" window; otherwise the match may occur anywhere within the window")       
MS(" columns.  The window always applies to line specification searchs.")     
MS(" It may be turned off with the N option on find and exchange commands.")
MS(" A '@' character anywhere in the pattern means zero or more") 
MS(' characters may be skipped during matching on this line,')
MS(' and the shortest possible match is used for non-RE matching.') 
MS(' A "\" is the escape character, it is not part of the match') 
MS(' but instead removes any special meaning from the next character.') 
MS(" Use '\@' or '\\' to find  '@' or '\' respectively.") 
] 
  
KEYTEST('PL') 
MS('PL Edit - Pending line edit using special control characters.') 
MS('  The string entered after the command character describes what') 
MS('  changes to make to the pending line. Special characters are :') 
MS(' ') 
MS('   cntl B  - Break the line at this position')
MS('   cntl C  - Delete characters')
MS('   cntl R  - Replace characters') 
MS('   cntl S  - Insert character') 
MS('   cntl T  - Truncate line')
MS('   cntl X  - Extend line')
MS(' ') 
MS('   / (current prompt) - Leave the character in this position unchanged')  
MS(' ') 
MS(' Example: ')
MS(' ') 
MS('   This is the old line') 
MS(' /P////////<cntl C>XXX<cntl S>a<cntl R>/new') 
MS('   This is a new line') 
] 
  
  
KEYTEST('RE') 
MS('Regular Expression  - A class of string specifications.') 
MS(" Examples :") 
MS(" To change the word IN to INPUT but not LINE to LINPUTE use :") 
MS("       X/:IN:/INPUT/")
MS(" To change  'getc(xxx)' to 'getch(xxx,file)' where xxx can vary use :") 
MS("       X/getc({[^)]*})/getch(&1,file)/")
MS(' Note that this will not work if xxx contains a right parenthesis. ') 
MS(' ') 
MS(' Regular expressions are enabled with a SE RE ON command.') 
MS(' ') 
MS(' Metacharacters are used to denote special field types.') 
MS(' Any character can be reverted (escaped) to itself by preceding ')
MS(' it with a "\".  The metacharacters are : ')
MS(' ') 
MS('  .       any character except the end of a line')
MS('  ^       beginning of the window (line)')
MS('  $       end of the line or window, whichever is shorter') 
MS('  [xyz]   character class (any one of these characters)') 
MS('  [^wxy]  negated character class (all but these characters)')
MS('  *       closure (zero or more occurrences of the previous pattern)')
MS('  +       transitive closure (one or more occurrences)')
MS('  <n>     repeat previous pattern n times') 
MS('  @       indefinite character match (shorthand for  .*)')
MS('  :       transition between alphanumerics and other characters') 
MS('  {xyz}   tagged field to be recalled by &n in the substitute string')
MS("  &n      n'th tagged field; used only in the substitute string") 
MS("          (1 <= n <= 9; '&' by itself is the matched field )")
MS("  >n      same as &n but shift substitute string to upper case")
MS("  <n      same as &n but shift substitute string to lower case")
MS(' ') 
MS(" A dash between alphanumerics in a character class specifies a range")
MS(" such as [0-9],[A-Z], or [A-Z0-9].  Character classes may also include")
MS(" escaped characters such as [\^\\] which means the class [ ^ or \ ].")
MS(' Closures extend to the longest possible match.') 
] 
  
if( keyt('LS')\keyt('+')\keyt('-')\keyt('.')\keyt('*')\ % 
    keyt('$')\keyt('>')\keyt(23440B)\keyt(60040B) ) [ 
MS('Line specifications.')
MS(' Many of the commands have optional line specification in front of')
MS(' them. These may be the absolute line numbers or one of the special') 
MS(' characters. They may also have + or - offsets. For example to list ')
MS(" the last 20 lines in a file use (the slash is Edit's prompt):")
MS(' ') 
MS('   /$-19 l')
MS(' ') 
MS(' Special characters are :') 
MS(' ') 
MS('   .  current line')
MS('   $  last line') 
MS('   >  same as $') 
MS('   -  backward relative to current line') 
MS('   ^  backward relative to current line') 
MS('   +  forward relative to current line')
MS('   *  line number of the first line spec. Legal only in the second spec') 
MS("   'pattern'      search forward for the pattern")
MS("   `pattern`      search backward for the pattern") 
MS(' ') 
MS(" If a null search pattern is given ( ''  or  `` ) it defaults to the")
MS(" F command pattern.  If a pattern is given it becomes the next default.") 
] 
  
KEYTEST('^')
MS('^') 
MS(" In line specifications '^' is backwards n.  See ?,LS.")
MS(" In patterns '^' is the default anchor character. See ?,PA or ?,RE.") 
] 
  
KEYTEST('\')
MS('\') 
MS(' Default escape character.  When the escape character is found in')       
MS(' a command it is removed and next character has no special meaning.') 
] 
  
KEYTEST('|')
MS('|') 
MS(' Multiple commands may be placed on a line or in the run string,')
MS(' delimited by the vertical bar "|" ( Ex. RU,EDIT, file ,tp|ts|s).') 
] 
  
KEYTEST('A')
MS('A') 
MS(' Abort.') 
] 
  
KEYTEST('B')
MS('[1][$] B /pattern/ [A][V][Q][N]') 
MS(' Find from beginning of file.') 
] 
  
KEYTEST('C')
MS('Ctext') 
MS(' Perform pl edit on current line then go to next line.')
] 
  
KEYTEST('CO') 
MS(' l1 [*] CO [Q]')
MS('  Copy lines in range to after current line.')
] 
KEYTEST('D')
MS('[.+1][$] D /pattern/ [A][V][Q][N]') 
MS(' Delete until pattern is found. ')
MS(' If the first line spec is not given then always delete the current line')
MS(' regardless of pattern match on current line.') 
 ]
  
KEYTEST('EC') 
MS('EC namr') 
MS(' Create file and exit.')
] 
  
KEYTEST('ER') 
MS('ER [namr] ')
MS(' Replace file and exit.') 
] 
  
  
KEYTEST('WC') 
MS('WC namr') 
MS(' Create new file and remain in the editor.')
] 
  
KEYTEST('WR') 
MS('WR [namr]') 
MS(' Write file, remain in editor. Source file is the default.')
MS(' If a namr is given the file must already exist.')
] 
  
  
KEYTEST('F')
MS('[.+1][$] F /pattern/ [A][V][Q][N]') 
MS(' Find pattern in specified range.') 
] 
  
KEYTEST('FC') 
MS('FCL') 
MS(" Close list file.  The list file is opened when a file name is given")
MS(' as the optional namr in the L or K command.  If it is open a plus sign') 
MS(' can be used in place of the namr to append to the open file.') 
MS(' ') 
MS('FCS') 
MS(' Close source file.  Original file remains unchanged.') 
MS(' This command removes the default file for ER and WR.') 
] 
  
KEYTEST('FI') 
MS('FI namr') 
MS(' File input.  This command deletes all lines in current workspace') 
MS(' then reads in a new file.  The ER and WR defualts are set.') 
] 
  
if(keyt('G'))[
MS('[.][*] G/pattern/substitute/ [N][R][S]')
MS(' X without listing.') 
] 
  
if(keyt('H ') \keyt('HE') \ keyt('?'))[ 
MS('H [command] or  ? [command]') 
MS(' Give help about commands.  HE,ALL  will list all help messages.')
] 
  
KEYTEST('HL') 
MS('HL')
MS(' Ruler line.')
] 
  
KEYTEST('I')
MS('[.] Itext') 
MS(' Insert text before current line.') 
] 
  
KEYTEST('J')
MS('[.] J') 
MS('  Join current line and next line.')
] 
  
KEYTEST('K')
MS('[.][$]K [max] [+] [list namr]') 
MS(' Kill (delete) lines in range but do not delete more lines than') 
MS(' the max spec. Default max is one if range is not specified') 
MS(' otherwise it is the entire range. If the list namr is specified')
MS(" the deleted lines are copied to it.  When it is given the max ") 
MS(" can be given or 'K,,list namr' can be used. A plus sign ( + )  in")
MS(' front of the list namr means append to this file.  The list file') 
MS(' is left open and can be appended to by just giving a plus sign.')
MS(' FCL will close the list file.')
] 
  
KEYTEST('KB') 
MS('KB')
MS(' Kill trailing blanks.')
] 
  
IF(KEYT('L') \ KEYT('LU') \ KEYT('LN') ) [
MS('[.][$] L [max] [+] [list namr]')
MS(' List lines in range but do not list more lines than max.') 
MS(' Default max is 20 lines.  If a list namr is specified then max ')
MS(" can be given or 'L,,list namr' can be used. A plus sign ( + )  in")
MS(' front of the list namr means append to this file.  The list file') 
MS(' is left open and can be appended to by just giving a plus sign.')
MS(' FCL will close the list file.')
MS(' ') 
MS('LN')
MS(' Numbered list.  Same as L but turn on numbers.  Numbers stay on until')
MS(' a LU command.')
MS(' ') 
MS('LU')
MS(' Unnumbered list.  Same as L but turn off numbers.  Numbers stay off until')
MS(' a LN command.')
] 
  
  
KEYTEST('LE') 
MS('[.] LE')
MS(' Length of current line in characters.')
] 
  
KEYTEST('LI') 
MS('LI')
MS(' Number of lines in the file.') 
] 
  
  
KEYTEST('M')
MS('M namr')
MS(' Merge file into work area. Merge starts after current line.')
] 
  
 RETURN 
 END
  
  
  
"      SUBROUTINE EHMSG(MESS,L),92074-1X010 REV.2034 800818"
      INTEGER MESS(L) 
      COMMON /lstlu/ lstlu
      common/key/ key 
  
      CALL EXEC(100002B,LSTLU,'  _',-3) 
 96   goto 100
 97   CALL EXEC(100002b,lstlu,MESS,L) 
 98   goto 100
 99   CONTINUE
      IF(  ifbrk(junk) ^= 0 ) 
          key = 0 
       return 
  
100   key = 0 
      RETURN
      END 
  
"      LOGICAL FUNCTION keyt(TEST),92074-1X010 REV.2034 800818" 
      INTEGER TEST
      LOGICAL KEYFG 
      COMMON /KEYFG/ KEYFG
      COMMON /KEY/ KEY
      IF( KEY .EQ. 'AL') [
         MS(' ')
         MS(' ')
         ]
      keyt = ( (TEST .EQ. KEY) \ (KEY .EQ. 'AL')) 
      IF(keyt)
        KEYFG = .TRUE.
      END 
  
                                                                                                                                                                                                                                        