home *** CD-ROM | disk | FTP | other *** search
/ Programmer's ROM - The Computer Language Library / programmersrom.iso / ada / tools / a970.src < prev    next >
Encoding:
Text File  |  1988-05-03  |  93.1 KB  |  3,516 lines

  1. ::::::::::
  2. a970.dis
  3. ::::::::::
  4. --
  5. -- Distribution file for A970
  6. --    This programs the TVI 970 and was written in Ada
  7. --
  8.  
  9. --
  10. -- Documentation
  11. --    Prologue
  12. --    Runoff source, Runoff output, and DEC Help file
  13. --
  14. a970.pro
  15. p970.rno
  16. p970.doc
  17. p970.hlp
  18.  
  19. --
  20. -- Pascal Source
  21. --
  22. p970.pas
  23.  
  24. --
  25. -- Ada Source
  26. --
  27. a970.ada
  28. ::::::::::
  29. a970.pro
  30. ::::::::::
  31.  
  32. -------- SIMTEL20 Ada Software Repository Prologue ------------
  33. --                                                           -*
  34. -- Unit name    : A970 (P970, or PROG970)
  35. -- Version      : 1.7
  36. -- Author       : Freeman Moore
  37. --              : TI Ada Technology Branch
  38. --              : PO Box 801, MS 8006
  39. --              : McKinney, TX  75069
  40. -- DDN Address  : FMOORE%TI-EG at CSNET-RELAY
  41. -- Copyright    : (c) N/A
  42. -- Date created :  26 Apr 85
  43. -- Release date :  26 Apr 85
  44. -- Last update  :  26 Apr 85
  45. -- Machine/System Compiled/Run on :  DG MV 10000 (ROLM ADE)
  46. --                    DEC VAX 11/785 (DEC Ada)
  47. --                                                           -*
  48. ---------------------------------------------------------------
  49. --                                                           -*
  50. -- Keywords     :  TVI970 Terminal, Terminal, Terminal Programming
  51. ----------------:
  52. --
  53. -- Abstract     :  
  54. ----------------:  
  55. -- 
  56. --      PROG970 in Pascal, by Rick Conn
  57. --               converted to Ada by Freeman Moore, April 1985
  58. -- 
  59. --      The purpose of PROG970 is to Program the TVI 970 terminal from
  60. --      a file, setting a variety of its features.  These features include
  61. --      the following:
  62. -- 
  63. --              o User Message Line
  64. --              o Function Keys
  65. --              o Cursor Type
  66. --              o Key Click
  67. --              o 25th Line Display
  68. --              o Answerback Sequence
  69. --              o Programmable Keys
  70. --              o Personal Messages
  71. --              o Other User-Definable Char Sequences
  72. -- 
  73. --                                                           -*
  74. ------------------ Revision history ---------------------------
  75. --                                                           -*
  76. -- DATE         VERSION    AUTHOR                  HISTORY
  77. -- 4/26/85    1.7    Freeman Moore        Initial Release
  78. --                                                           -*
  79. ------------------ Distribution and Copyright -----------------
  80. --                                                           -*
  81. -- This prologue must be included in all copies of this software.
  82. --
  83. -- This software is released to the Ada community.
  84. -- This software is released to the Public Domain (note:
  85. --   software released to the Public Domain is not subject
  86. --   to copyright protection).
  87. -- Restrictions on use or distribution:  NONE
  88. --                                                           -*
  89. ------------------ Disclaimer ---------------------------------
  90. --                                                           -*
  91. -- This software and its documentation are provided "AS IS" and
  92. -- without any expressed or implied warranties whatsoever.
  93. -- No warranties as to performance, merchantability, or fitness
  94. -- for a particular purpose exist.
  95. --
  96. -- Because of the diversity of conditions and hardware under
  97. -- which this software may be used, no warranty of fitness for
  98. -- a particular purpose is offered.  The user is advised to
  99. -- test the software thoroughly before relying on it.  The user
  100. -- must assume the entire risk and liability of using this
  101. -- software.
  102. --
  103. -- In no event shall any person or organization of people be
  104. -- held responsible for any direct, indirect, consequential
  105. -- or inconsequential damages or lost profits.
  106. --                                                           -*
  107. -------------------END-PROLOGUE--------------------------------
  108. ::::::::::
  109. p970.rno
  110. ::::::::::
  111. .headers on
  112. .title _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ P970 - A Utility for Programming the TVI 970 
  113. .RIGHT MARGIN +15
  114. .LEFT MARGIN +15
  115. .ap
  116. .tab stops 5,10,15,20,25,30,35,40,45,50,55,60
  117. .skip 5
  118. .CENTER +15;  P970 Version 1.6
  119. .skip 1
  120. .CENTER +15;  A Utility for Programming the TVI 970
  121. .skip 1
  122. .CENTER +15;  by Richard Conn
  123. .skip 3
  124.     The purpose of P970 is to program the user's TVI 970 computer
  125. terminal based on commands in a text file.  The following operations
  126. on the TVI 970 can be performed by this program:
  127. .skip 1
  128. .nf
  129.         1. Define the content of the
  130.             User Message on the 25th line
  131.         2. Select the 25th line
  132.         3. Engage/Disengage Key Click
  133.         4. Program the 16 Function Keys
  134.         5. Select the Cursor Type
  135.         6. Program the Answerback Sequence
  136.         7. Program the Programmable Keys
  137.         8. Output any text to the terminal
  138. .fill
  139. .skip 3
  140. .CENTER +15;  ^& Running the P970 Program \&
  141.     P970 performs its function by reading a text file (which may be
  142. created with any VAX/VMS editor) and sending command sequences to the user's
  143. TVI 970 based on P970 commands in the text file.
  144.     A symbol should be defined (via your LOGIN.COM file) which
  145. looks something like this:
  146. .skip 1
  147. .CENTER +15;  P970:=="$USER1:[ACSL.TOOLS.P970]P970 "
  148. .skip 1
  149. As per the norm, you may define the symbol name ('P970') as you desire.
  150. Note the leading dollar sign (_$) -- it is an important part of this symbol
  151. and must not be omitted.  It is sometimes useful to keep all of your P970
  152. command files in one directory, and, consequently, it is convenient to have
  153. a command which runs P970 on files which come from this directory by
  154. default.  My default directory is [CONN.P970], and I store all of my P970
  155. files here.  A symbol, H970 (for Home 970), is defined as follows:
  156. .skip 1
  157. .CENTER +15;  H970:=="$USER1:[ACSL.TOOLS.P970]P970 [CONN.P970]"
  158. .skip 1
  159. The command
  160. .skip 1
  161. .CENTER +15;  "H970 LOGIN.970"
  162. .skip 1
  163. is expanded into
  164. .skip 1
  165. .CENTER +15;  "$USER1:[ACSL.TOOLS.P970]P970 [CONN.P970]LOGIN.970"
  166. .skip 1
  167.     Once the symbol is defined, the program is invoked in one of
  168. two ways:
  169. .skip 1
  170. .nf
  171.     P970        <-- run program; user is prompted for file
  172.     P970 file    <-- run program on specified file
  173.     (same for H970)
  174. .fill
  175. .skip 3
  176. .CENTER +15;  ^& File Structure \&
  177.     The file read by P970 is simply an ASCII text file (which can
  178. be prepared by any conventional text editor under VAX/VMS).  Each line
  179. of the file begins with a command letter ('A', 'C', 'E',
  180. 'F', 'K', 'L', 'O', 'P', 'U',
  181. or ';') followed by command-specific information.  When a line is
  182. encountered which does not begin with one of these characters, processing
  183. is halted (end of command set is assumed).
  184. For all commands, the case of the command letter and any options
  185. which follow it are not significant.  Case is only significant
  186. in the text fields of selected commands.
  187. .skip 3
  188. .CENTER +15;  ^& Potential User Problems \&
  189. .skip 1
  190. 1. VAX/VMS Automatic Line Wrapping
  191.     Your VAX/VMS environment should be set up with NOWRAP as a terminal
  192. characteristic if your output strings are very long.  P970 uses two techniques,
  193. depending on the command used, to generate output to the terminal.  One
  194. technique simply outputs the characters as presented in the P970 command
  195. file.  The other technique involves translating each
  196. character into a sequence of ASCII-code digits and outputting up to three
  197. digits
  198. followed by a semicolon for each character.  Consequently, the output using
  199. this second technique, as is found in the User Message command and others,
  200. can become quite long, and if WRAP is set
  201. on your terminal characteristics, the message will be cut short when the
  202. number of characters output equals the number of columns on your terminal.
  203.     To enable NOWRAP on your terminal, have your LOGIN.COM file
  204. issue the following command:
  205. .skip 1
  206. .CENTER +15;  _"SET TERMINAL/NOWRAP_"
  207. .skip 2
  208. 2. Output Buffer Size
  209.     The next limitation you may
  210. encounter is the size of the output buffer used by P970.
  211. A maximum of 4096 characters is permitted in an output stream
  212. before the buffer will overflow and a message to this effect will appear
  213. on your screen.  Many successive uses of the O (literal output)
  214. command could cause this overflow to happen.  This problem can be corrected by
  215. interjecting a command like:
  216. .skip 1
  217.         O_^M_^J
  218. .skip 1
  219. in your command file.  _^M is a carriage return, _^J is a line feed, and
  220. the two combine to generate the New Line code which flushes the buffer
  221. (actually, _^J is probably the only character needed, but _^M _^J looks
  222. better on your terminal).
  223. .skip 3
  224. .CENTER +15;  ^& Comments \&
  225.     Any line in the file beginning with a semicolon (_;) is a comment
  226. line, and the entire line is ignored.
  227. .skip 3
  228. .CENTER +15;  ^& Text Output Convention \&
  229.     Functions 1 (define User Message), 4 (program function keys),
  230. 6 (program answerback message), 7 (program programmable keys),
  231. and 8 (output text to terminal)
  232. permit the user to output text to the terminal.  P970 provides for some
  233. convenience to the user in that escape sequences are available which allow
  234. any character within the 128-character ASCII character set to be included
  235. in this text.  This is particularly useful when the function keys are being
  236. programmed with escape sequences, such as clear screen.
  237. .test page 10
  238.     The escape sequences available to the P970 programmer are:
  239. .skip 1
  240. .nf
  241.         _^c - output control char (uparrow, char)
  242.         _\D - output DELETE char (7F Hex)
  243.         _\E - output ESCAPE char (1B Hex)
  244.         _\c - output following char literally
  245.             '_\_^' outputs '_^'
  246.             '_\_\' outputs '_\'
  247. .fill
  248. .skip 1
  249.     For example, to include a carriage return character in
  250. a text sequence, the two-character combination '_^M' or '_^m' is available.
  251. To output the clear screen sequence to the TVI 970, the characters
  252. '_\E[2J' will output ESCAPE, '[', '2', and 'J' to do this.
  253.     Any character following an uparrow (_^) or backslash (_\) will
  254. be capitalized if it is lower-case alphabetic.
  255.     Any 7-bit value in the ASCII-128 character set can be generated
  256. by using this output convention.  The following table summarizes how to
  257. do this.
  258. .skip 1
  259. .test page 22
  260. .nf
  261.         Character    Required
  262.          Desired    Character
  263.         Hex ASCII    Sequence
  264.         ---------    --------
  265.         00   NUL       _^@
  266.         01   SOH       _^A
  267.            ...         ..
  268.         1A   SUB       _^Z
  269.         1B   ESC       _^[  (note: _\E also works)
  270.         1C   FS        _^_\
  271.         1D   GS        _^]
  272.         1E   RS        _^_^
  273.         1F   US        _^__
  274.         20   SP 
  275.         21   _!         _!
  276.            ...         ..
  277.         7E   _~         _~
  278.         7F   DEL       _\D  (note: special sequence)
  279. .fill
  280. .skip 1
  281.     Note that a delete character (_\D) is useful in programming
  282. the function keys in that this character is used in function key
  283. sequences to chain one function key to another.
  284. .skip 3
  285. .test page 15
  286. .CENTER +15;  ^& P970 Commands \&
  287. .skip 2
  288.     This section lists the nine P970 commands in alphabetical order.
  289. The commands covered in this section are:
  290. .skip 1
  291. .tab stops 8,16,24,32,40,48,56
  292. .NO FILL
  293.     Command        Function Performed
  294.     -------        -------- ---------
  295.     A<text>        Program the Answerback Sequence
  296.     Ccr            Select the Cursor Type
  297.     E<text>        End Command Lines
  298.     Fst n <text>    Program a Function Key
  299.     Kk             Engage/Disengage Key Click
  300.     Ll             Select the 25th Line
  301.     O<text>        Output any Text to the Terminal
  302.     P n <text>    Program the Programmable Keys
  303.     U<text>        Load the User Message
  304. .fill
  305. .tab stops 5,10,15,20,25,30,35,40,45,50,55,60
  306. .skip 2
  307. .test page 10
  308. 1. ^& A - Program the Answerback Sequence \&
  309. .skip 1
  310. Syntax:
  311.     A<text>
  312. .skip 1
  313. Comments:
  314.     The answerback sequence is transmitted to the computer by
  315. striking Control-BREAK.  This sequence is at most 24 characters long,
  316. and it is the user's responsibility to insure that he does not place more
  317. than 24 characters in this sequence.
  318. .skip 1
  319. Examples:
  320. .NO FILL 
  321.     Ac McACSL_^M_^M
  322.         -- program the answerback key with a
  323.             connect command to McACSL
  324. .fill
  325. .skip 2
  326. .test page 10
  327. 2. ^& C - Select the Cursor Type \&
  328. .skip 1
  329. Syntax:
  330. .nf
  331.     Ccr
  332.         c = 'B' for block (defaults to underline)
  333.         r = 'S' for steady (defaults to blinking)
  334. .fill
  335. .skip 1
  336. Comments:
  337.     The C command selects the cursor type.  If both the 'S' and
  338. 'B' options are selected, their order is not significant.
  339. .skip 1
  340. Examples:
  341. .nf
  342.     C    <-- select blinking underline
  343.     CS    <-- select steady underline
  344.     CB    <-- select blinking block
  345.     CBS    <-- select steady block
  346. .fill
  347. .skip 2
  348. .test page 10
  349. 3. ^& E - Exit P970 Command Series \&
  350. .skip 1
  351. Syntax:
  352.     E<any text>
  353. .skip 1
  354. Comments:
  355.     The E command signals the end of the P970 command lines in
  356. the file.  Any subsequent lines following the line beginning with
  357. the letter 'E' are ignored.  Any text following the E command is
  358. ignored.
  359. .skip 1
  360. Examples:
  361.     E     <-- End of Command Lines
  362. .skip 2
  363. .test page 15
  364. 4. ^& F - Program the 16 Function Keys \&
  365. .skip 1
  366. Syntax:
  367. .nf
  368.     Fst n <text>
  369.         s = 'S' if function key is to be shifted;
  370.             omitting the character 'S' selects the
  371.             non-shifted function key
  372.         t = 'L' if text is transmitted to terminal only;
  373.             omitting the character 'L' selects
  374.             transmission of the text to the computer
  375.         n = number of function key (1 to 16)
  376.         <text> = text of function key
  377. .fill
  378. .skip 1
  379. Comments:
  380.     The function key definition command allows the programmer to
  381. define text strings to be sent to the remote computer or executed locally
  382. by the terminal.
  383.     In sending text strings to the remote computer, it is frequently
  384. useful to terminate the text strings in certain ways, namely with a carriage
  385. return or a space.  To do this, the escape sequences come in handy.  The
  386. characters '_^M' or '_^m' represent the carriage return, and '_\_ ' represents
  387. a space.
  388.     In sending commands to the terminal, it is frequently useful to
  389. be able to define the ESCAPE character.  The sequence '_\E' represents the
  390. ESCAPE character.  Also, the sequence '_\D' represents the DELETE character
  391. (if you ever need it).
  392.     See the section on ^& Text Output Convention \& for more detail.
  393.     If both 'S' and 'L' options are given, the order in which they
  394. are presented is not significant.
  395. .skip 1
  396. .test page 10
  397. Examples:
  398. .nf
  399.     F 1 dir_^M    <-- function key 1 (unshifted) sends
  400.                 'dir' followed by a carriage
  401.                 return to the computer
  402.     Fs 1 dir_\    <-- function key 1 (shifted) sends
  403.                 'dir' followed by a space
  404.                 to the computer
  405.     FL 2 _\E[2J    <-- function key 2 sends ESCAPE
  406.                 followed by '[2J' to the
  407.                 terminal
  408. .fill
  409. .skip 2
  410. .test page 10
  411. 5. ^& K - Engage/Disengage Key Click \&
  412. .skip 1
  413. Syntax:
  414. .nf
  415.     Kk
  416.         k = 'Y' to enable key click
  417.         k = anything else to disable key click
  418. .fill
  419. .skip 1
  420. Comments:
  421.     The key click is enabled or disabled by this command.
  422. .skip 1
  423. Examples:
  424. .nf
  425.     K    <-- disable key click
  426.     Ky    <-- enable key click
  427. .fill
  428. .skip 2
  429. .test page 10
  430. 6. ^& L - Select the 25th Line \&
  431. .skip 1
  432. Syntax:
  433. .nf
  434.     Ll
  435.         l = 'U' selects the User Message
  436.         l = 'S' selects the Status Message
  437.         l = anything else blanks out the 25th line
  438. .fill
  439. .skip 1
  440. Comments:
  441.     The L command selects the 25th line.  Since it is executed
  442. as soon as it is encountered, the L command may also be used to blank
  443. out the message line, load it, and then enable it when the processing
  444. is done.
  445. .skip 1
  446. .test page 10
  447. Examples:
  448. .skip 1
  449. .nf
  450.     1.  Sequence --
  451.         L        <-- blank out 25th line
  452.         Umy message    <-- store 'my message' in User Msg
  453.         LU        <-- enable User Msg on 25th line
  454.     2.  Sequence --
  455.         LS        <-- enable status msg on 25th line
  456. .fill
  457. .skip 2
  458. .test page 10
  459. 7. ^& O - Output any Text to the Terminal \&
  460. .skip 1
  461. Syntax:
  462.     O<text>
  463. .skip 1
  464. Comments:
  465.     The O command simply outputs the following text to the
  466. user's terminal.  Any escape sequence
  467. not covered by the other commands can be sent to the terminal rather easily.
  468. .skip 1
  469. Examples:
  470. .nf
  471.     O_\E[2J    <-- clear screen
  472.     OHello, world    <-- print message
  473. .fill
  474. .skip 2
  475. .test page 10
  476. 8. ^& P - Program the Programmable Keys \&
  477. .skip 1
  478. Syntax:
  479.     P n <text>
  480. .skip 1
  481. Comments:
  482.     The P command programs the programmable key indicated with
  483. the indicated character sequence.  It is the user's responsibility to
  484. ensure that the character sequence fits within the key's buffer.
  485. Any escape sequence
  486. not covered by the other commands can be sent to the terminal rather easily.
  487.     The value of "n" is the PS number of the key (from 0 to 62).
  488. Refer to pages 99-100 of the TVI 970 Operator's Manual
  489. (Programming the Programmable Keys) for details on these
  490. values.
  491. .skip 1
  492. .test page 5
  493. Examples:
  494. .skip 1
  495. .nf
  496.     P 24 _^B     <-- change left arrow to _^B
  497.     P 19 _\EV    <-- change shifted up arrow to ESC V
  498. .fill
  499. .skip 2
  500. .test page 10
  501. 9. ^& U - Set the User Message on the 25th Line \&
  502. .skip 1
  503. Syntax:
  504.     U<text>
  505. .skip 1
  506. Comments:
  507.     The text immediately following the letter U is output into the user
  508. message.  The L command must also select the User Message for this output
  509. to appear on the screen (see the L command below).
  510.     Your VAX/VMS environment should be set up with NOWRAP as a terminal
  511. characteristic if your User Message is very long.  P970 uses the "normal"
  512. technique of generating the User Message, which involves translating each
  513. character into a sequence of ASCII digits and outputting up to three digits
  514. followed by a semicolon for each character.  Consequently, the output to
  515. program a User Message tends to become quite long, and if WRAP is set
  516. on your terminal characteristics, the message will be cut short when the
  517. number of characters output equals the number of columns on your terminal.
  518. However, even with NOWRAP enabled, the next limitation is the size of the
  519. output buffer.  This limitation allows on the order of 40 characters
  520. maximum in the User Message.
  521.     To enable NOWRAP on your terminal, have your LOGIN.COM file
  522. issue the following command:  _"SET TERMINAL/NOWRAP_"
  523. .skip 1
  524. Examples:
  525. .nf
  526.     Umy message    <-- store 'my message' in user line
  527. .fill
  528. .page
  529. .skip 4
  530. .CENTER +15;  ^& Sample Configuration Files \&
  531. .skip 3
  532. FILE 1:
  533. .skip 2
  534. .test page 22
  535. .nf
  536.     ; User line blank, keyclick off, define user message,
  537.     ;   set 25th line to user message
  538.     L
  539.     K
  540.     uD  Dir  ChDir  Who
  541.     Lu
  542.     ; Define function keys
  543.     F 1 d_^M
  544.     Fs 1 d_\ 
  545.     F 2 dir_^M
  546.     F 3 cd_\ 
  547.     F 4 who_^M
  548.     fL 16 _\E[0U
  549.     fsL 16 _\E[0V
  550.     ; Define cursor
  551.     C
  552.     ; Print message
  553.     O_\E[2J Welcome, Rick
  554.     ; Done
  555.     E
  556. .fill
  557. .skip 3
  558. .test page 22
  559. FILE 2:
  560. .skip 2
  561. .nf
  562.     ; Define user message line
  563.     U1=Dir  2=CD  3=Who
  564.     ; Define function keys
  565.     Fn 1 d_^m
  566.     fs 1 d_\ 
  567.     fn 2 cd_\ 
  568.     fs 2 pwd_^M
  569.     fn 3 who_^m
  570.     ; Define cursor
  571.     cb
  572.     ; Done
  573.     e
  574.     These lines which follow the E command may
  575.     contain any text desired by the user
  576. .fill
  577. .skip 3
  578. .test page 30
  579. FILE 3:
  580. .skip 2
  581. .nf
  582.     ; TVI 970 configuration file for Rick Conn
  583.     ; Set the Answerback message:
  584.     Ac mcacsl_^M_^M
  585.     ; Program the user message:
  586.     L
  587.     u1=D  2=Dir  3=CD  4=Who
  588.     Lu
  589.     ; Turn off key click
  590.     K
  591.     ; Define Function Keys
  592.     ;  1 = d<CR>
  593.     ;  1 shifted = d<SP>
  594.     ;  2 = dir<CR>
  595.     ;  3 = cd<SP>
  596.     ;  4 = who<CR>
  597.     ; 15 = smooth scroll
  598.     ; 15 shifted = jump scroll
  599.     ; 16 = advance to next page
  600.     ; 16 shifted = backup to last page
  601.     F 1 d_^M
  602.     Fs 1 d_\ 
  603.     F 2 dir_^M
  604.     F 3 cd_\ 
  605.     F 4 who_^M
  606.     FL 15 _\E[_?4h
  607.     FLS 15 _\E[_?4l
  608.     fL 16 _\E[0U
  609.     fsL 16 _\E[0V
  610.     ; Set Cursor to Blinking Underline
  611.     C
  612.     ; Clear Screen and Print Message
  613.     O_\E[2J Welcome, Rick
  614.     ; Done
  615.     E
  616. .fill
  617. ::::::::::
  618. p970.doc
  619. ::::::::::
  620.  
  621.  
  622.  
  623.  
  624.  
  625.  
  626.                                      P970 Version 1.6
  627.  
  628.  
  629.  
  630.                           A Utility for Programming the TVI 970
  631.  
  632.  
  633.  
  634.                                      by Richard Conn
  635.  
  636.  
  637.  
  638.  
  639.  
  640.  
  641.  
  642.  
  643.  
  644.                     The purpose of P970 is to program the  user's  TVI  970
  645.  
  646.                computer  terminal  based  on  commands in a text file.  The
  647.  
  648.                following operations on the TVI 970 can be performed by this
  649.  
  650.                program:
  651.  
  652.  
  653.  
  654.                          1. Define the content of the
  655.  
  656.                               User Message on the 25th line
  657.  
  658.                          2. Select the 25th line
  659.  
  660.                          3. Engage/Disengage Key Click
  661.  
  662.                          4. Program the 16 Function Keys
  663.  
  664.                          5. Select the Cursor Type
  665.  
  666.                          6. Program the Answerback Sequence
  667.  
  668.                          7. Program the Programmable Keys
  669.  
  670.                          8. Output any text to the terminal
  671.  
  672.  
  673.  
  674.  
  675.  
  676.  
  677.  
  678.                                  Running the P970 Program
  679.  
  680.                                  _______ ___ ____ _______
  681.  
  682.  
  683.  
  684.                     P970 performs its  function  by  reading  a  text  file
  685.  
  686.                (which  may  be created with any VAX/VMS editor) and sending
  687.  
  688.                command sequences to  the  user's  TVI  970  based  on  P970
  689.  
  690.                commands in the text file.
  691.  
  692.  
  693.  
  694.                     A symbol should be defined (via  your  LOGIN.COM  file)
  695.  
  696.                which looks something like this:
  697.  
  698.  
  699.  
  700.                           P970:=="$USER1:[ACSL.TOOLS.P970]P970 "
  701.  
  702.  
  703.  
  704.                As per the norm, you may define the symbol name ('P970')  as
  705.  
  706.                you  desire.   Note  the leading dollar sign ($) -- it is an
  707.  
  708.                important part of this symbol and must not be  omitted.   It
  709.  
  710.                is  sometimes  useful to keep all of your P970 command files
  711.  
  712.                in one directory, and, consequently,  it  is  convenient  to
  713.  
  714.                have a command which runs P970 on files which come from this
  715.  
  716.                directory by default.  My default directory is  [CONN.P970],
  717.  
  718.                and  I store all of my P970 files here.  A symbol, H970 (for
  719.  
  720.                Home 970), is defined as follows:
  721.  
  722.  
  723.  
  724.                     H970:=="$USER1:[ACSL.TOOLS.P970]P970 [CONN.P970]"
  725.  
  726.  
  727.  
  728.                The command
  729.  
  730.  
  731.  
  732.                                      "H970 LOGIN.970"
  733.  
  734.  
  735.  
  736.                is expanded into
  737.  
  738.                P970 - A Utility for Programming the TVI 970          Page 2
  739.  
  740.  
  741.  
  742.  
  743.  
  744.                    "$USER1:[ACSL.TOOLS.P970]P970 [CONN.P970]LOGIN.970"
  745.  
  746.  
  747.  
  748.  
  749.  
  750.                     Once the symbol is defined, the program is  invoked  in
  751.  
  752.                one of two ways:
  753.  
  754.  
  755.  
  756.                     P970      <-- run program; user is prompted for file
  757.  
  758.                     P970 file <-- run program on specified file
  759.  
  760.                     (same for H970)
  761.  
  762.  
  763.  
  764.  
  765.  
  766.  
  767.  
  768.                                       File Structure
  769.  
  770.                                       ____ _________
  771.  
  772.  
  773.  
  774.                     The file read by P970 is  simply  an  ASCII  text  file
  775.  
  776.                (which can be prepared by any conventional text editor under
  777.  
  778.                VAX/VMS).  Each line of  the  file  begins  with  a  command
  779.  
  780.                letter ('A', 'C', 'E', 'F', 'K', 'L', 'O', 'P', 'U', or ';')
  781.  
  782.                followed by command-specific information.  When  a  line  is
  783.  
  784.                encountered   which   does  not  begin  with  one  of  these
  785.  
  786.                characters, processing is halted  (end  of  command  set  is
  787.  
  788.                assumed).   For all commands, the case of the command letter
  789.  
  790.                and any options which follow it are not  significant.   Case
  791.  
  792.                is only significant in the text fields of selected commands.
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799.  
  800.                                   Potential User Problems
  801.  
  802.                                   _________ ____ ________
  803.  
  804.  
  805.  
  806.                1.  VAX/VMS Automatic Line Wrapping
  807.  
  808.  
  809.  
  810.                     Your VAX/VMS environment should be set up  with  NOWRAP
  811.  
  812.                as a terminal characteristic if your output strings are very
  813.  
  814.                long.  P970 uses two techniques, depending  on  the  command
  815.  
  816.                used,  to  generate  output  to the terminal.  One technique
  817.  
  818.                simply outputs the  characters  as  presented  in  the  P970
  819.  
  820.                command file.  The other technique involves translating each
  821.  
  822.                character  into  a  sequence  of   ASCII-code   digits   and
  823.  
  824.                outputting  up  to  three digits followed by a semicolon for
  825.  
  826.                each character.  Consequently, the output using this  second
  827.  
  828.                technique,  as  is  found  in  the  User Message command and
  829.  
  830.                others, can become quite long, and if WRAP is  set  on  your
  831.  
  832.                terminal characteristics, the message will be cut short when
  833.  
  834.                the number of characters output equals the number of columns
  835.  
  836.                on your terminal.
  837.  
  838.  
  839.  
  840.                     To enable NOWRAP on your terminal, have your  LOGIN.COM
  841.  
  842.                file issue the following command:
  843.  
  844.  
  845.  
  846.                                   "SET TERMINAL/NOWRAP"
  847.  
  848.  
  849.  
  850.  
  851.  
  852.                2.  Output Buffer Size
  853.  
  854.                P970 - A Utility for Programming the TVI 970          Page 3
  855.  
  856.  
  857.  
  858.  
  859.  
  860.                     The next limitation you may encounter is  the  size  of
  861.  
  862.                the   output  buffer  used  by  P970.   A  maximum  of  4096
  863.  
  864.                characters is permitted  in  an  output  stream  before  the
  865.  
  866.                buffer  will  overflow  and  a  message  to this effect will
  867.  
  868.                appear on your  screen.   Many  successive  uses  of  the  O
  869.  
  870.                (literal  output)  command  could  cause  this  overflow  to
  871.  
  872.                happen.  This problem can be  corrected  by  interjecting  a
  873.  
  874.                command like:
  875.  
  876.  
  877.  
  878.  
  879.  
  880.                     O^M^J
  881.  
  882.  
  883.  
  884.                in your command file.  ^M is a carriage return, ^J is a line
  885.  
  886.                feed,  and  the  two  combine  to generate the New Line code
  887.  
  888.                which flushes the buffer (actually, ^J is probably the  only
  889.  
  890.                character needed, but ^M ^J looks better on your terminal).
  891.  
  892.  
  893.  
  894.  
  895.  
  896.  
  897.  
  898.                                          Comments
  899.  
  900.                                          ________
  901.  
  902.  
  903.  
  904.                     Any line in the file beginning with a semicolon (;)  is
  905.  
  906.                a comment line, and the entire line is ignored.
  907.  
  908.  
  909.  
  910.  
  911.  
  912.  
  913.  
  914.                                   Text Output Convention
  915.  
  916.                                   ____ ______ __________
  917.  
  918.  
  919.  
  920.                     Functions 1 (define User Message), 4 (program  function
  921.  
  922.                keys),   6   (program   answerback   message),   7  (program
  923.  
  924.                programmable keys), and 8 (output text to  terminal)  permit
  925.  
  926.                the  user to output text to the terminal.  P970 provides for
  927.  
  928.                some convenience to the user in that  escape  sequences  are
  929.  
  930.                available which allow any character within the 128-character
  931.  
  932.                ASCII character set to be included in this  text.   This  is
  933.  
  934.                particularly   useful  when  the  function  keys  are  being
  935.  
  936.                programmed with escape sequences, such as clear screen.
  937.  
  938.  
  939.  
  940.                     The escape sequences available to the  P970  programmer
  941.  
  942.                are:
  943.  
  944.  
  945.  
  946.                          ^c - output control char (uparrow, char)
  947.  
  948.                          \D - output DELETE char (7F Hex)
  949.  
  950.                          \E - output ESCAPE char (1B Hex)
  951.  
  952.                          \c - output following char literally
  953.  
  954.                               '\^' outputs '^'
  955.  
  956.                               '\\' outputs '\'
  957.  
  958.  
  959.  
  960.  
  961.  
  962.                     For example, to include a carriage return character  in
  963.  
  964.                a  text sequence, the two-character combination '^M' or '^m'
  965.  
  966.                is available.  To output the clear screen  sequence  to  the
  967.  
  968.                TVI  970,  the  characters  '\E[2J' will output ESCAPE, '[',
  969.  
  970.                '2', and 'J' to do this.
  971.  
  972.                P970 - A Utility for Programming the TVI 970          Page 4
  973.  
  974.  
  975.  
  976.  
  977.  
  978.                     Any character following an uparrow (^) or backslash (\)
  979.  
  980.                will be capitalized if it is lower-case alphabetic.
  981.  
  982.  
  983.  
  984.                     Any 7-bit value in the ASCII-128 character set  can  be
  985.  
  986.                generated  by  using  this output convention.  The following
  987.  
  988.                table summarizes how to do this.
  989.  
  990.  
  991.  
  992.                          Character Required
  993.  
  994.                           Desired  Character
  995.  
  996.                          Hex ASCII Sequence
  997.  
  998.                          --------- --------
  999.  
  1000.                          00   NUL     ^@
  1001.  
  1002.                          01   SOH     ^A
  1003.  
  1004.                             ...       ..
  1005.  
  1006.                          1A   SUB     ^Z
  1007.  
  1008.                          1B   ESC     ^[  (note: \E also works)
  1009.  
  1010.                          1C   FS      ^\
  1011.  
  1012.                          1D   GS      ^]
  1013.  
  1014.                          1E   RS      ^^
  1015.  
  1016.                          1F   US      ^_
  1017.  
  1018.                          20   SP 
  1019.  
  1020.                          21   !        !
  1021.  
  1022.                             ...       ..
  1023.  
  1024.                          7E   ~        ~
  1025.  
  1026.                          7F   DEL     \D  (note: special sequence)
  1027.  
  1028.  
  1029.  
  1030.  
  1031.  
  1032.                     Note  that  a  delete  character  (\D)  is  useful   in
  1033.  
  1034.                programming the function keys in that this character is used
  1035.  
  1036.                in function key sequences  to  chain  one  function  key  to
  1037.  
  1038.                another.
  1039.  
  1040.  
  1041.  
  1042.  
  1043.  
  1044.  
  1045.  
  1046.                                        P970 Commands
  1047.  
  1048.                                        ____ ________
  1049.  
  1050.  
  1051.  
  1052.  
  1053.  
  1054.  
  1055.  
  1056.                     This  section  lists  the   nine   P970   commands   in
  1057.  
  1058.                alphabetical  order.   The  commands covered in this section
  1059.  
  1060.                are:
  1061.  
  1062.  
  1063.  
  1064.                 Command         Function Performed
  1065.  
  1066.                 -------         -------- ---------
  1067.  
  1068.                 A<text>         Program the Answerback Sequence
  1069.  
  1070.                 Ccr             Select the Cursor Type
  1071.  
  1072.                 E<text>         End Command Lines
  1073.  
  1074.                 Fst n <text>    Program a Function Key
  1075.  
  1076.                 Kk              Engage/Disengage Key Click
  1077.  
  1078.                 Ll              Select the 25th Line
  1079.  
  1080.                 O<text>         Output any Text to the Terminal
  1081.  
  1082.                 P n <text>      Program the Programmable Keys
  1083.  
  1084.                 U<text>         Load the User Message
  1085.  
  1086.                P970 - A Utility for Programming the TVI 970          Page 5
  1087.  
  1088.  
  1089.  
  1090.  
  1091.  
  1092.                1.  A - Program the Answerback Sequence
  1093.  
  1094.                    _ _ _______ ___ __________ ________
  1095.  
  1096.  
  1097.  
  1098.                Syntax:
  1099.  
  1100.  
  1101.  
  1102.                     A<text>
  1103.  
  1104.  
  1105.  
  1106.                Comments:
  1107.  
  1108.  
  1109.  
  1110.                     The answerback sequence is transmitted to the  computer
  1111.  
  1112.                by  striking  Control-BREAK.   This  sequence  is at most 24
  1113.  
  1114.                characters long, and it  is  the  user's  responsibility  to
  1115.  
  1116.                insure  that  he  does  not place more than 24 characters in
  1117.  
  1118.                this sequence.
  1119.  
  1120.  
  1121.  
  1122.                Examples:
  1123.  
  1124.                     Ac McACSL^M^M
  1125.  
  1126.                          -- program the answerback key with a
  1127.  
  1128.                               connect command to McACSL
  1129.  
  1130.  
  1131.  
  1132.  
  1133.  
  1134.                2.  C - Select the Cursor Type
  1135.  
  1136.                    _ _ ______ ___ ______ ____
  1137.  
  1138.  
  1139.  
  1140.                Syntax:
  1141.  
  1142.                     Ccr
  1143.  
  1144.                          c = 'B' for block (defaults to underline)
  1145.  
  1146.                          r = 'S' for steady (defaults to blinking)
  1147.  
  1148.  
  1149.  
  1150.                Comments:
  1151.  
  1152.  
  1153.  
  1154.                     The C command selects the cursor type.  If both the 'S'
  1155.  
  1156.                and   'B'   options   are   selected,  their  order  is  not
  1157.  
  1158.                significant.
  1159.  
  1160.  
  1161.  
  1162.                Examples:
  1163.  
  1164.                     C    <-- select blinking underline
  1165.  
  1166.                     CS   <-- select steady underline
  1167.  
  1168.                     CB   <-- select blinking block
  1169.  
  1170.                     CBS  <-- select steady block
  1171.  
  1172.  
  1173.  
  1174.  
  1175.  
  1176.                3.  E - Exit P970 Command Series
  1177.  
  1178.                    _ _ ____ ____ _______ ______
  1179.  
  1180.  
  1181.  
  1182.                Syntax:
  1183.  
  1184.  
  1185.  
  1186.                     E<any text>
  1187.  
  1188.  
  1189.  
  1190.                Comments:
  1191.  
  1192.  
  1193.  
  1194.                     The E command signals the end of the P970 command lines
  1195.  
  1196.                in  the  file.   Any  subsequent  lines  following  the line
  1197.  
  1198.                beginning  with  the  letter  'E'  are  ignored.   Any  text
  1199.  
  1200.                following the E command is ignored.
  1201.  
  1202.  
  1203.  
  1204.                Examples:
  1205.  
  1206.                P970 - A Utility for Programming the TVI 970          Page 6
  1207.  
  1208.  
  1209.  
  1210.  
  1211.  
  1212.                     E    <-- End of Command Lines
  1213.  
  1214.  
  1215.  
  1216.  
  1217.  
  1218.                4.  F - Program the 16 Function Keys
  1219.  
  1220.                    _ _ _______ ___ __ ________ ____
  1221.  
  1222.  
  1223.  
  1224.                Syntax:
  1225.  
  1226.                     Fst n <text>
  1227.  
  1228.                          s = 'S' if function key is to be shifted;
  1229.  
  1230.                               omitting the character 'S' selects the
  1231.  
  1232.                               non-shifted function key
  1233.  
  1234.                          t = 'L' if text is transmitted to terminal only;
  1235.  
  1236.                               omitting the character 'L' selects
  1237.  
  1238.                               transmission of the text to the computer
  1239.  
  1240.                          n = number of function key (1 to 16)
  1241.  
  1242.                          <text> = text of function key
  1243.  
  1244.  
  1245.  
  1246.                Comments:
  1247.  
  1248.  
  1249.  
  1250.                     The  function  key  definition   command   allows   the
  1251.  
  1252.                programmer  to  define text strings to be sent to the remote
  1253.  
  1254.                computer or executed locally by the terminal.
  1255.  
  1256.  
  1257.  
  1258.                     In sending text strings to the remote computer,  it  is
  1259.  
  1260.                frequently  useful  to terminate the text strings in certain
  1261.  
  1262.                ways, namely with a carriage return or a space.  To do this,
  1263.  
  1264.                the  escape sequences come in handy.  The characters '^M' or
  1265.  
  1266.                '^m' represent the carriage return, and  '\ '  represents  a
  1267.  
  1268.                space.
  1269.  
  1270.  
  1271.  
  1272.                     In sending commands to the terminal, it  is  frequently
  1273.  
  1274.                useful  to  be  able  to  define  the ESCAPE character.  The
  1275.  
  1276.                sequence '\E' represents the ESCAPE  character.   Also,  the
  1277.  
  1278.                sequence  '\D'  represents the DELETE character (if you ever
  1279.  
  1280.                need it).
  1281.  
  1282.  
  1283.  
  1284.                     See the section on  Text  Output  Convention  for  more
  1285.  
  1286.                                         ____  ______  __________
  1287.  
  1288.                detail.
  1289.  
  1290.  
  1291.  
  1292.                     If both 'S' and 'L' options are  given,  the  order  in
  1293.  
  1294.                which they are presented is not significant.
  1295.  
  1296.  
  1297.  
  1298.                Examples:
  1299.  
  1300.                     F 1 dir^M <-- function key 1 (unshifted) sends
  1301.  
  1302.                                    'dir' followed by a carriage
  1303.  
  1304.                                    return to the computer
  1305.  
  1306.                     Fs 1 dir\ <-- function key 1 (shifted) sends
  1307.  
  1308.                                    'dir' followed by a space
  1309.  
  1310.                                    to the computer
  1311.  
  1312.                     FL 2 \E[2J     <-- function key 2 sends ESCAPE
  1313.  
  1314.                                    followed by '[2J' to the
  1315.  
  1316.                                    terminal
  1317.  
  1318.  
  1319.  
  1320.  
  1321.  
  1322.                P970 - A Utility for Programming the TVI 970          Page 7
  1323.  
  1324.  
  1325.  
  1326.  
  1327.  
  1328.                5.  K - Engage/Disengage Key Click
  1329.  
  1330.                    _ _ ________________ ___ _____
  1331.  
  1332.  
  1333.  
  1334.                Syntax:
  1335.  
  1336.                     Kk
  1337.  
  1338.                          k = 'Y' to enable key click
  1339.  
  1340.                          k = anything else to disable key click
  1341.  
  1342.  
  1343.  
  1344.                Comments:
  1345.  
  1346.  
  1347.  
  1348.                     The key click is enabled or disabled by this command.
  1349.  
  1350.  
  1351.  
  1352.                Examples:
  1353.  
  1354.                     K    <-- disable key click
  1355.  
  1356.                     Ky   <-- enable key click
  1357.  
  1358.  
  1359.  
  1360.  
  1361.  
  1362.                6.  L - Select the 25th Line
  1363.  
  1364.                    _ _ ______ ___ ____ ____
  1365.  
  1366.  
  1367.  
  1368.                Syntax:
  1369.  
  1370.                     Ll
  1371.  
  1372.                          l = 'U' selects the User Message
  1373.  
  1374.                          l = 'S' selects the Status Message
  1375.  
  1376.                          l = anything else blanks out the 25th line
  1377.  
  1378.  
  1379.  
  1380.                Comments:
  1381.  
  1382.  
  1383.  
  1384.                     The L command selects  the  25th  line.   Since  it  is
  1385.  
  1386.                executed  as  soon  as  it is encountered, the L command may
  1387.  
  1388.                also be used to blank out the message  line,  load  it,  and
  1389.  
  1390.                then enable it when the processing is done.
  1391.  
  1392.  
  1393.  
  1394.                Examples:
  1395.  
  1396.  
  1397.  
  1398.                     1.  Sequence --
  1399.  
  1400.                          L         <-- blank out 25th line
  1401.  
  1402.                          Umy message    <-- store 'my message' in User Msg
  1403.  
  1404.                          LU        <-- enable User Msg on 25th line
  1405.  
  1406.                     2.  Sequence --
  1407.  
  1408.                          LS        <-- enable status msg on 25th line
  1409.  
  1410.  
  1411.  
  1412.  
  1413.  
  1414.                7.  O - Output any Text to the Terminal
  1415.  
  1416.                    _ _ ______ ___ ____ __ ___ ________
  1417.  
  1418.  
  1419.  
  1420.                Syntax:
  1421.  
  1422.  
  1423.  
  1424.                     O<text>
  1425.  
  1426.  
  1427.  
  1428.                Comments:
  1429.  
  1430.  
  1431.  
  1432.                     The O command simply outputs the following text to  the
  1433.  
  1434.                user's  terminal.   Any  escape  sequence not covered by the
  1435.  
  1436.                other commands can be sent to the terminal rather easily.
  1437.  
  1438.  
  1439.  
  1440.                Examples:
  1441.  
  1442.                     O\E[2J    <-- clear screen
  1443.  
  1444.                P970 - A Utility for Programming the TVI 970          Page 8
  1445.  
  1446.  
  1447.  
  1448.  
  1449.  
  1450.                     OHello, world  <-- print message
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.                8.  P - Program the Programmable Keys
  1457.  
  1458.                    _ _ _______ ___ ____________ ____
  1459.  
  1460.  
  1461.  
  1462.                Syntax:
  1463.  
  1464.  
  1465.  
  1466.                     P n <text>
  1467.  
  1468.  
  1469.  
  1470.                Comments:
  1471.  
  1472.  
  1473.  
  1474.                     The P command programs the programmable  key  indicated
  1475.  
  1476.                with  the  indicated  character  sequence.  It is the user's
  1477.  
  1478.                responsibility to ensure that the  character  sequence  fits
  1479.  
  1480.                within the key's buffer.  Any escape sequence not covered by
  1481.  
  1482.                the other commands  can  be  sent  to  the  terminal  rather
  1483.  
  1484.                easily.
  1485.  
  1486.  
  1487.  
  1488.                     The value of "n" is the PS number of the key (from 0 to
  1489.  
  1490.                62).  Refer to pages 99-100 of the TVI 970 Operator's Manual
  1491.  
  1492.                (Programming the Programmable Keys)  for  details  on  these
  1493.  
  1494.                values.
  1495.  
  1496.  
  1497.  
  1498.                Examples:
  1499.  
  1500.  
  1501.  
  1502.                     P 24 ^B   <-- change left arrow to ^B
  1503.  
  1504.                     P 19 \EV  <-- change shifted up arrow to ESC V
  1505.  
  1506.  
  1507.  
  1508.  
  1509.  
  1510.                9.  U - Set the User Message on the 25th Line
  1511.  
  1512.                    _ _ ___ ___ ____ _______ __ ___ ____ ____
  1513.  
  1514.  
  1515.  
  1516.                Syntax:
  1517.  
  1518.  
  1519.  
  1520.                     U<text>
  1521.  
  1522.  
  1523.  
  1524.                Comments:
  1525.  
  1526.  
  1527.  
  1528.                     The text immediately following the letter U  is  output
  1529.  
  1530.                into  the  user message.  The L command must also select the
  1531.  
  1532.                User Message for this output to appear on  the  screen  (see
  1533.  
  1534.                the L command below).
  1535.  
  1536.  
  1537.  
  1538.                     Your VAX/VMS environment should be set up  with  NOWRAP
  1539.  
  1540.                as  a  terminal  characteristic if your User Message is very
  1541.  
  1542.                long.  P970 uses the "normal" technique  of  generating  the
  1543.  
  1544.                User Message, which involves translating each character into
  1545.  
  1546.                a sequence of ASCII digits and outputting up to three digits
  1547.  
  1548.                followed  by  a semicolon for each character.  Consequently,
  1549.  
  1550.                the output to program a User Message tends to  become  quite
  1551.  
  1552.                long,  and  if WRAP is set on your terminal characteristics,
  1553.  
  1554.                the message will be cut short when the number of  characters
  1555.  
  1556.                output  equals  the  number  of  columns  on  your terminal.
  1557.  
  1558.                However, even with NOWRAP enabled, the  next  limitation  is
  1559.  
  1560.                the  size  of  the output buffer.  This limitation allows on
  1561.  
  1562.                the order of 40 characters maximum in the User Message.
  1563.  
  1564.                P970 - A Utility for Programming the TVI 970          Page 9
  1565.  
  1566.  
  1567.  
  1568.  
  1569.  
  1570.                     To enable NOWRAP on your terminal, have your  LOGIN.COM
  1571.  
  1572.                file issue the following command:  "SET TERMINAL/NOWRAP"
  1573.  
  1574.  
  1575.  
  1576.                Examples:
  1577.  
  1578.                     Umy message    <-- store 'my message' in user line
  1579.  
  1580.                P970 - A Utility for Programming the TVI 970         Page 10
  1581.  
  1582.  
  1583.  
  1584.  
  1585.  
  1586.                                 Sample Configuration Files
  1587.  
  1588.                                 ______ _____________ _____
  1589.  
  1590.  
  1591.  
  1592.  
  1593.  
  1594.  
  1595.  
  1596.                FILE 1:
  1597.  
  1598.  
  1599.  
  1600.  
  1601.  
  1602.                     ; User line blank, keyclick off, define user message,
  1603.  
  1604.                     ;   set 25th line to user message
  1605.  
  1606.                     L
  1607.  
  1608.                     K
  1609.  
  1610.                     uD  Dir  ChDir  Who
  1611.  
  1612.                     Lu
  1613.  
  1614.                     ; Define function keys
  1615.  
  1616.                     F 1 d^M
  1617.  
  1618.                     Fs 1 d\ 
  1619.  
  1620.                     F 2 dir^M
  1621.  
  1622.                     F 3 cd\ 
  1623.  
  1624.                     F 4 who^M
  1625.  
  1626.                     fL 16 \E[0U
  1627.  
  1628.                     fsL 16 \E[0V
  1629.  
  1630.                     ; Define cursor
  1631.  
  1632.                     C
  1633.  
  1634.                     ; Print message
  1635.  
  1636.                     O\E[2J Welcome, Rick
  1637.  
  1638.                     ; Done
  1639.  
  1640.                     E
  1641.  
  1642.  
  1643.  
  1644.  
  1645.  
  1646.  
  1647.  
  1648.                FILE 2:
  1649.  
  1650.  
  1651.  
  1652.  
  1653.  
  1654.                     ; Define user message line
  1655.  
  1656.                     U1=Dir  2=CD  3=Who
  1657.  
  1658.                     ; Define function keys
  1659.  
  1660.                     Fn 1 d^m
  1661.  
  1662.                     fs 1 d\ 
  1663.  
  1664.                     fn 2 cd\ 
  1665.  
  1666.                     fs 2 pwd^M
  1667.  
  1668.                     fn 3 who^m
  1669.  
  1670.                     ; Define cursor
  1671.  
  1672.                     cb
  1673.  
  1674.                     ; Done
  1675.  
  1676.                     e
  1677.  
  1678.                     These lines which follow the E command may
  1679.  
  1680.                     contain any text desired by the user
  1681.  
  1682.  
  1683.  
  1684.  
  1685.  
  1686.  
  1687.  
  1688.                P970 - A Utility for Programming the TVI 970         Page 11
  1689.  
  1690.  
  1691.  
  1692.  
  1693.  
  1694.                FILE 3:
  1695.  
  1696.  
  1697.  
  1698.  
  1699.  
  1700.                     ; TVI 970 configuration file for Rick Conn
  1701.  
  1702.                     ; Set the Answerback message:
  1703.  
  1704.                     Ac mcacsl^M^M
  1705.  
  1706.                     ; Program the user message:
  1707.  
  1708.                     L
  1709.  
  1710.                     u1=D  2=Dir  3=CD  4=Who
  1711.  
  1712.                     Lu
  1713.  
  1714.                     ; Turn off key click
  1715.  
  1716.                     K
  1717.  
  1718.                     ; Define Function Keys
  1719.  
  1720.                     ;  1 = d<CR>
  1721.  
  1722.                     ;  1 shifted = d<SP>
  1723.  
  1724.                     ;  2 = dir<CR>
  1725.  
  1726.                     ;  3 = cd<SP>
  1727.  
  1728.                     ;  4 = who<CR>
  1729.  
  1730.                     ; 15 = smooth scroll
  1731.  
  1732.                     ; 15 shifted = jump scroll
  1733.  
  1734.                     ; 16 = advance to next page
  1735.  
  1736.                     ; 16 shifted = backup to last page
  1737.  
  1738.                     F 1 d^M
  1739.  
  1740.                     Fs 1 d\ 
  1741.  
  1742.                     F 2 dir^M
  1743.  
  1744.                     F 3 cd\ 
  1745.  
  1746.                     F 4 who^M
  1747.  
  1748.                     FL 15 \E[?4h
  1749.  
  1750.                     FLS 15 \E[?4l
  1751.  
  1752.                     fL 16 \E[0U
  1753.  
  1754.                     fsL 16 \E[0V
  1755.  
  1756.                     ; Set Cursor to Blinking Underline
  1757.  
  1758.                     C
  1759.  
  1760.                     ; Clear Screen and Print Message
  1761.  
  1762.                     O\E[2J Welcome, Rick
  1763.  
  1764.                     ; Done
  1765.  
  1766.                     E
  1767.  
  1768. ::::::::::
  1769. p970.hlp
  1770. ::::::::::
  1771. 1 P970
  1772. COMMAND NAME: P970 or H970
  1773. SYNTAX:
  1774.     P970 filename.typ
  1775. or    H970 filename.typ
  1776. PURPOSE:
  1777.     P970 programs various attributes of the Televideo 970 terminal
  1778. according to commands in the indicated file.  The command "P970" looks
  1779. for the file in the current (or indicated directory), while the command
  1780. "H970" looks for the file in the directory [CONN.P970].  A directory
  1781. prefix should not be used with the H970 command.
  1782.  
  1783. EXAMPLES:
  1784.     P970 setup1.970
  1785.         -- program the TVI970 from the file SETUP1.970 in
  1786.             the current directory
  1787.     H970 login.970
  1788.         -- program the TVI970 from the file LOGIN.970 in [CONN.P970]
  1789.  
  1790. 2 COMMANDS
  1791.  
  1792.     The following is a brief summary of the commands which may be
  1793. placed into a text file which is later read by P970 to program the terminal.
  1794. Details on these commands are available elsewhere in this HELP file.
  1795.  
  1796. Command        Function
  1797. -------        --------
  1798. ;<text>          Comment Line
  1799. A<text>         Load Answerback Message
  1800. Ccr             Cursor Type Selection
  1801. Fst n <text>    Load Function Key
  1802. KY or K          Enable/Disable Key Click
  1803. LU, LS, or L    Select User Message, Status Message or Blank Message
  1804. O<text>         Output any text
  1805. P n <text>       Program the Programmable Keys
  1806. U<text>          Load User Message
  1807. E<text>        End of P970 Command Lines
  1808.  
  1809.     See the P970 manual for details with examples of each of these
  1810. commands.
  1811.  
  1812. 1 E
  1813. P970 Command: E
  1814. Syntax: E<text>
  1815. Function:
  1816.     E indicates the end of the P970 command lines.  Any text which
  1817. follows the letter E and any lines which follow the line containing this
  1818. command are flushed.
  1819.  
  1820. 1 U
  1821. P970 Command: U
  1822. Syntax: U<text>
  1823. Function:
  1824.     U stores the text which immediately follows it in the User
  1825. Message.
  1826.     The LU command has to be issued to turn on the User Message.
  1827.  
  1828. 1 L
  1829. P970 Command: L
  1830. Syntax: Ll
  1831.         l=U to select User Message
  1832.         l=S to select Status Message
  1833.         l=other to select blank message
  1834. Function:
  1835.     L selects which of the three message lines will appear on the 25th
  1836. line of the screen.
  1837.  
  1838. 1 K
  1839. P970 Command: K
  1840. Syntax: Kk
  1841.         k=Y to enable Key Click
  1842.         k=other to disable Key Click
  1843. Function:
  1844.     K enables and disables the key click at the user's terminal.
  1845.  
  1846. 1 F
  1847. P970 Command: F
  1848. Syntax: Fst n <text>
  1849.         s=S if function key is shifted; omitting the char 'S'
  1850.             selects the non-shifted function key
  1851.         t=L to transmit the key string to the terminal only (local);
  1852.             omitting the char 'L' transmits the key string
  1853.             to the computer
  1854.         n=# (number of function key, from 1 to 16); this is required
  1855.         <text> is the text to store in the function key
  1856. Function:
  1857.     F stores text in the function keys.  Any ASCII character from 0
  1858. to 127 (7-bit ASCII) may be stored by this command.
  1859.  
  1860. 1 C
  1861. P970 Command: C
  1862. Syntax: Ccr
  1863.         c=B for block cursor; omitting the char 'B' selects an
  1864.             underline cursor
  1865.         r=S for steady cursor; omitting the char 'S' selects a
  1866.             blinking cursor
  1867. Function:
  1868.     C selects the cursor type.
  1869.  
  1870. 1 A
  1871. P970 Command: A
  1872. Syntax: A<text>
  1873. Function:
  1874.     A programs the answerback sequence.  This sequence is sent to
  1875. the computer by striking Control-BREAK.  It is at most 24 chars long.
  1876.  
  1877. 1 P
  1878. P970 Command: P
  1879. Syntax: P n <text>
  1880.         n=# (programmable key number, from 0 to 62)
  1881. Function:
  1882.     P stores the text into the programmable key indicated by 'n'.
  1883. The number of characters which may be stored varies with the key selected.
  1884. See the section on "Personalizing the 970" - "Programming the Keys" in
  1885. your TVI 970 manual for further details on key numbers and char sequence
  1886. lengths.
  1887.  
  1888. 1 O
  1889. P970 Command: O
  1890. Syntax: O<text>
  1891. Function:
  1892.     O outputs the following text to the terminal with a minimum
  1893. of interpretation.  Functions such as clear screen and message display
  1894. can be performed using this command.
  1895.  
  1896. 1 TEXT
  1897.  
  1898.     Several P970 commands, namely A, F, O, P and U, have an argument
  1899. which is a sequence of characters (indicated by <text> in the syntax
  1900. descriptions in this HELP file).  Any 7-bit ASCII character may be
  1901. represented in this text.  The following rules apply:
  1902.  
  1903.         ^c (uparrow, char) - output control char
  1904.         \D - output DELETE char (7F Hex)
  1905.         \E - output ESCAPE char (1B Hex)
  1906.         \c - output char 'c' literally
  1907.             '\^' outputs '^'
  1908.             '\\' outputs '\'
  1909.  
  1910.     Any character following an uparrow (^) or backslash (\)
  1911. will be capitalized if it is lower-case alphabetic.  See the section
  1912. on CHARS for a summary of all possible characters which can be output.
  1913.  
  1914. 1 CHARS
  1915.  
  1916.  Character    Required        This table summarizes the character
  1917.   Desired     Character        sequences required to output any of
  1918.  Hex ASCII    Sequence        the 128 7-bit ASCII characters.
  1919.  ---------    ---------
  1920.  00   NUL       ^@
  1921.  01   SOH       ^A
  1922.     ...           ..
  1923.  1A   SUB       ^Z
  1924.  1B   ESC       ^[ (note: \E also works)
  1925.  1C   FS       ^\
  1926.  1D   GS       ^]
  1927.  1E   RS       ^^
  1928.  1F   US       ^_
  1929.  20   SP
  1930.  21    !        !
  1931.     ...           ..
  1932.  7E    ~        ~
  1933.  7F   DEL       \D (note: special sequence)
  1934. ::::::::::
  1935. p970.pas
  1936. ::::::::::
  1937. program prog970 (input, output);
  1938. {
  1939.     PROG970.PAS  by Rick Conn
  1940.  
  1941.     The purpose of PROG970 is to Program the TVI 970 terminal from a file,
  1942.     setting a variety of its features.  These features include
  1943.     the following:
  1944.  
  1945.         o User Message Line
  1946.         o Function Keys
  1947.         o Cursor Type
  1948.         o Key Click
  1949.         o 25th Line Display
  1950.         o Answerback Sequence
  1951.         o Programmable Keys
  1952.         o Personal Messages
  1953.         o Other User-Definable Char Sequences
  1954.  
  1955.     PROG970 is divided into three major modules and one initialization
  1956.     and command selection mainline.  The three major modules are:
  1957.  
  1958.         1. Support Routines
  1959.             -- provide low-level I/O et al
  1960.             -- routines are dependent and ordered
  1961.         2. Routines for Terminal Output of Functions
  1962.             -- function-specific routines, such as
  1963.                 program function key n with string s
  1964.             -- routines are independent; order is alphabetical
  1965.             -- routines in module 1 called for support
  1966.         3. Command Processing Routines
  1967.             -- process command options and data for
  1968.                 specific commands
  1969.             -- routines are independent; order is alphabetical
  1970.             -- routines in modules 1 and 2 called for support
  1971.  
  1972. }
  1973.  
  1974. const
  1975.     version = 1.6;      { version number }
  1976.     str_length = 255;   { max length of strings }
  1977.     prompt_length = 17; { length of prompt string }
  1978.     delete = chr(127);  { DELETE character }
  1979.     escape = chr(27);   { ESCAPE character }
  1980.     cr = chr(13);       { CARRIAGE RETURN character }
  1981.     literal = '\';      { following char is accepted literally }
  1982.     control = '^';      { control char is represented }
  1983.     lit_esc = 'E';      { literal code for ESC char (\E) }
  1984.     lit_del = 'D';      { literal code for DEL char (\D) }
  1985.  
  1986. type
  1987.     str = packed array [1..str_length] of char;
  1988.     prompt_str = packed array [1..prompt_length] of char;
  1989.     cptr = ^char;
  1990. var
  1991.     message    : str;
  1992.     infile, fo : TEXT;
  1993.  
  1994. procedure lib$get_foreign (%descr line1 : str; %descr line2 : prompt_str);
  1995.     extern;
  1996.  
  1997. {----------------------------------------------------------------}
  1998. {
  1999.     1. Support Routines
  2000.         STOP_ALL
  2001.         UP
  2002.         TOUPPER
  2003.         DIGOUT
  2004.         CHAROUT
  2005.         PRINT_MESSAGE
  2006.         GET_MESSAGE
  2007.         GET_CHAR
  2008. }
  2009.  
  2010. procedure stop_all;
  2011. {
  2012.     STOP_ALL halts execution of the program when an EOF condition
  2013.     is detected prematurely.  It prints an appropriate error message.
  2014.  
  2015.     Inputs: None
  2016.     Outputs: None
  2017.     Side Effects: None (program is halted)
  2018. }
  2019. begin
  2020.     writeln;
  2021.     writeln ('Premature End of File on Input File');
  2022.     halt
  2023. ;
  2024. end;
  2025.  
  2026.  
  2027. procedure up;
  2028. {
  2029.     UP moves cursor up one line so screen info is not lost by
  2030.     running P970.
  2031.  
  2032.     Inputs: None
  2033.     Outputs: None
  2034.     Side Effects: None (cursor moves up)
  2035. }
  2036. begin
  2037.     write(fo, escape, 'M');   { \E M moves cursor up one line }
  2038. end;
  2039.  
  2040.  
  2041. function toupper (ch : char) : char;
  2042. {
  2043.     TOUPPER capitalizes the input character, if necessary.
  2044.  
  2045.     Inputs:  CH = char to capitalize
  2046.     Outputs:  TOUPPER = capitalized output
  2047.     Side Effects:  None
  2048. }
  2049. begin
  2050.     if (ord('a') <= ord(ch)) AND (ord(ch) <= ord('z')) then
  2051.         toupper := chr(ord(ch) - ord('a') + ord('A'))
  2052.       else
  2053.         toupper := ch;
  2054. end;  { TOUPPER }
  2055.  
  2056.  
  2057. procedure digout (dig : integer);
  2058. {
  2059.     DIGOUT outputs the digit (whose value must be in the range from
  2060.     0 to 9) to the terminal as a single ASCII character (from '0' to
  2061.     '9').
  2062.  
  2063.     Inputs:  DIG = integer from 0 to 9
  2064.     Outputs:  None (char is printed)
  2065.     Side Effects:  None
  2066. }
  2067. begin
  2068.     write(fo, chr(dig + ord('0')) );
  2069. end;  { DIGOUT }
  2070.  
  2071.  
  2072. procedure charout (ch : char);
  2073. {
  2074.     CHAROUT outputs the character to the terminal as up to three
  2075.     ASCII digit characters.  These characters represent the ASCII
  2076.     code value of the input character.  For example, 'A' = 65 decimal,
  2077.     so CHAROUT('A') outputs '65'.
  2078.  
  2079.     Inputs:  CH = char to output
  2080.     Outputs:  None (digit chars are printed)
  2081.     Side Effects:  None
  2082. }
  2083. var
  2084.     ch_val : integer;
  2085.     leading_zero : boolean;
  2086. begin
  2087.     ch_val := ord(ch);
  2088.     leading_zero := TRUE;
  2089.  
  2090.     if (ch_val > 99) then begin  { process 100's }
  2091.         leading_zero := FALSE;
  2092.         digout (ch_val div 100);  { output 100's digit }
  2093.         ch_val := ch_val - (ch_val div 100)*100;  { take away 100's }
  2094.         end;
  2095.  
  2096.     if (ch_val > 9) then begin  { process 10's }
  2097.         digout (ch_val div 10);  { output 10's digit }
  2098.         ch_val := ch_val - (ch_val div 10)*10;  { take away 10's }
  2099.         end
  2100.     else if (NOT leading_zero) then write(fo,'0');  { output embedded '0' }
  2101.  
  2102.     digout (ch_val);  { output 1's }
  2103. end;  { CHAROUT }
  2104.  
  2105.  
  2106. procedure print_message;
  2107. {
  2108.     PRINT_MESSAGE prints the message contained in the array MESSAGE
  2109.     to the screen.
  2110.  
  2111.     Inputs:  MESSAGE = string passed globally
  2112.     Outputs:  None (string is printed)
  2113.     Side Effects:  None
  2114. }
  2115. var
  2116.     ctrl, idx : integer;
  2117.  
  2118. begin
  2119.     idx := 1;
  2120.     while (message[idx] <> chr(0)) do begin
  2121.         case message[idx] of
  2122.             control : begin  { control char processing }
  2123.                 idx := idx + 1;  { next char }
  2124.                 ctrl := ord(toupper(message[idx])) - ord('@');
  2125.                 charout (chr(ctrl));
  2126.                 end;
  2127.             literal : begin  { literal char follows }
  2128.                 idx := idx + 1;  { next char }
  2129.                 case toupper(message[idx]) of
  2130.                     lit_del : charout (delete);
  2131.                     lit_esc : charout (escape);
  2132.                     OTHERWISE charout (message[idx]);
  2133.                     end;
  2134.                 end;
  2135.             OTHERWISE charout (message[idx]);  { output char }
  2136.             end;  { case message[idx] }
  2137.         idx := idx + 1;
  2138.         if (message[idx] <> chr(0)) then write (fo,';');  { separator }
  2139.         end;
  2140. end;  { PRINT_MESSAGE }
  2141.  
  2142.  
  2143. procedure get_message;
  2144. {
  2145.     GET_MESSAGE clears the message buffer and reads a line
  2146.     of text from the keyboard into it.
  2147.  
  2148.     Inputs:  None (keyboard)
  2149.     Outputs:  MESSAGE (global) = user input followed by NULLs
  2150.     Side Effects:  None
  2151. }
  2152. var
  2153.     idx : integer;
  2154. begin
  2155.     if EOF(infile) then for idx:=1 to str_length do message[idx]:=' '
  2156.       else readln (infile, message);
  2157.     idx := str_length;
  2158.     while ((message[idx] = ' ') AND (idx <> 1)) do begin
  2159.         message[idx] := chr(0);  { NULL fill at end }
  2160.         idx := idx - 1;
  2161.         end;
  2162.     if (message[idx] = literal) then begin  { last char was a space }
  2163.         idx := idx + 1;
  2164.         message[idx] := ' ';
  2165.         end;
  2166. end;  { GET_MESSAGE }
  2167.  
  2168.  
  2169. function get_char : char;
  2170. {
  2171.     GET_CHAR inputs a line from the user and returns only the first
  2172.     character of it (non-blank).
  2173.  
  2174.     Inputs:  None (keyboard)
  2175.     Outputs:  Char returned
  2176.     Side Effects:  None
  2177. }
  2178. var
  2179.     message_save : str;
  2180.     idx : integer;
  2181. begin
  2182.     for idx := 1 to str_length do message_save[idx] := message[idx];
  2183.     get_message;
  2184.     idx := 1;
  2185.     while (message[idx] = ' ') do idx := idx + 1;  { skip to non-blank }
  2186.     get_char := message[idx];  { set return char }
  2187.     for idx := 1 to str_length do message[idx] := message_save[idx];
  2188. end;  { GET_CHAR }
  2189.  
  2190. {----------------------------------------------------------------}
  2191. {
  2192.     2. Routines for Terminal Output of Functions
  2193.         ANSWER_BACK
  2194.         CURSOR
  2195.         FUNCTION_KEY
  2196.         KEY_CLICK
  2197.         LINE_TYPE
  2198.         OTHER_TEXT
  2199.         PERSONAL_MESSAGE
  2200.         PROGRAM_KEYS (not yet used)
  2201.         USER_LINE
  2202. }
  2203.  
  2204. procedure answer_back;
  2205. {
  2206.     ANSWER_BACK programs the answer-back string with the message
  2207.     contained in the message buffer.  It is assumed that the message
  2208.     is 24 characters or less.
  2209.  
  2210.     Inputs:  MESSAGE (global) = string to be placed in message line
  2211.     Outputs:  None (Message is stored)
  2212.     Side Effects:  None
  2213. }
  2214. begin
  2215.     write (fo, escape);   { send ESCAPE char }
  2216.     write (fo, '\72;');   { store Answer Back Message }
  2217.     print_message;    { output message }
  2218.     writeln(fo); up;  { new line to end sequence }
  2219. end;  { USER_LINE }
  2220.  
  2221.  
  2222.  
  2223. procedure cursor (ctype : char);
  2224. {
  2225.     CURSOR programs the cursor type.
  2226.  
  2227.     Inputs:  CTYPE = cursor type ('0'=blinking block, '1'=steady block,
  2228.         '2'=blinking underline, '3'=steady underline)
  2229.     Outputs:  None (cursor is set)
  2230.     Side Effects:  None
  2231. }
  2232. begin
  2233.     write (fo, escape);  { ESCAPE char }
  2234.     write (fo, '[3;');   { set cursor }
  2235.     write (fo, ctype);   { cursor type }
  2236.     write (fo, 'z');     { done }
  2237. end;  { CURSOR }
  2238.  
  2239.  
  2240. procedure function_key (key : integer; shifted, xmit : boolean);
  2241. {
  2242.     FUNCTION_KEY programs a function key with the string contained
  2243.     in MESSAGE.
  2244.  
  2245.     Inputs:  MESSAGE (global) = message to go into function key
  2246.          KEY = number of function key (1 to 16)
  2247.          SHIFTED = is function key shifted (T/F)?
  2248.          XMIT = transmit string to computer (T/F)?
  2249.     Outputs:  None (key is programmed)
  2250.     Side Effects:  None
  2251. }
  2252. begin
  2253.     write (fo, escape);  { send ESCAPE char }
  2254.     write (fo, '|');     { programming function key }
  2255.     if (shifted) then charout (chr(key+16))  { shifted key number }
  2256.       else charout (chr(key));  { unshifted key number }
  2257.     write (fo, ';');     { separator }
  2258.         if (xmit) then write (fo, '1')  { full duplex - send to computer only }
  2259.       else write (fo, '2');  { local }
  2260.     write (fo, ';');     { separator }
  2261.     print_message;       { send message }
  2262.     writeln(fo); up;     { new line to end sequence }
  2263. end;  { FUNCTION_KEY }
  2264.  
  2265.  
  2266. procedure key_click (click : boolean);
  2267. {
  2268.     KEY_CLICK turns on the key click if CLICK is TRUE or off the
  2269.     key click if CLICK is FALSE.
  2270.  
  2271.     Inputs:  CLICK = T if key click ON, F if key click OFF
  2272.     Outputs:  None
  2273.     Side Effects:  None (key click is affected)
  2274. }
  2275. begin
  2276.     if (click) then begin  { turn on key click }
  2277.         write (fo, escape);
  2278.         writeln (fo, '[6;0z'); up;
  2279.         end
  2280.       else begin           { turn off key click }
  2281.         write (fo, escape);
  2282.         writeln (fo, '[6;1z'); up;
  2283.         end;
  2284. end;  { KEY_CLICK }
  2285.  
  2286.  
  2287. procedure line_type (selection : integer);
  2288. {
  2289.     LINE_TYPE selects the 25th line as blank, status, or user
  2290.     message.
  2291.  
  2292.     Inputs:  SELECTION = type (0=blank, 1=status, 2=user message)
  2293.     Outputs:  None
  2294.     Side Effects:  None (line type is selected)
  2295. }
  2296. begin
  2297.     write (fo, escape);  { ESCAPE char }
  2298.     write (fo, '[0;');   { prefix }
  2299.     write (fo, chr(selection + ord('0')));  { digit char '0', '1', '2' }
  2300.     writeln (fo, 'z'); up;
  2301. end;  { LINE_TYPE }
  2302.  
  2303.  
  2304. procedure other_text;
  2305. {
  2306.     OTHER_TEXT simply echoes the text which follows the O command
  2307.     as-is (with escape sequence processing).
  2308.  
  2309.     Inputs:  None
  2310.     Outputs:  None
  2311.     Side Effects:  None (text is sent to terminal)
  2312. }
  2313. var
  2314.     idx : integer;
  2315.     chx : char;
  2316. begin
  2317.     idx := 1;
  2318.     repeat
  2319.         case toupper(message[idx]) of
  2320.             control : begin  { output control char }
  2321.                 idx := idx + 1;
  2322.                 chx := toupper(message[idx]);
  2323.                 chx := chr(ord(chx)-ord('@'));
  2324.                 write (fo, chx);
  2325.                 end;
  2326.             literal : begin  { output literal char }
  2327.                 idx := idx + 1;
  2328.                 chx := message[idx];
  2329.                 case toupper(chx) of
  2330.                     lit_del : write (fo, delete);
  2331.                     lit_esc : write (fo, escape);
  2332.                     OTHERWISE write (fo, chx);
  2333.                     end;
  2334.                 end;
  2335.             OTHERWISE write (fo, message[idx]);
  2336.             end;
  2337.         idx := idx + 1;
  2338.     until (message[idx] = chr(0));
  2339. end;  { OTHER_TEXT }
  2340.  
  2341. procedure personal_message (msg : integer);
  2342. {
  2343.     PERSONAL_MESSAGE loads a personal message into the terminal.
  2344.     It is the user's responsibility to ensure that the personal
  2345.     message does not exceed 9 characters in length.
  2346.  
  2347.     Inputs:  MESSAGE (global) = message to go into terminal
  2348.          MSG = Personal Message Number (0 to 7)
  2349.     Outputs:  None (message is programmed)
  2350.     Side Effects:  None
  2351. }
  2352. begin
  2353.     write (fo, escape);      { send ESCAPE char }
  2354.     write (fo, '^');         { personal message }
  2355.     charout (chr(msg+64));   { PS number for message }
  2356.     write (fo, ';');         { separator }
  2357.     print_message;           { send message }
  2358.     writeln(fo); up;         { new line to end sequence }
  2359. end;  { PERSONAL_MESSAGE }
  2360.  
  2361. procedure program_keys (ps : integer);
  2362. {
  2363.     PROGRAM_KEYS programs a user-programmable key with a character
  2364.     sequence.  It is the programmer's responsibility to ensure that
  2365.     no more than the maximum number of bytes allowed for a particular
  2366.     key are transmitted into it.
  2367.  
  2368.     Inputs:  MESSAGE (global) = message to go into prog key
  2369.          PS = Ps value which identifies key
  2370.     Outputs:  None (key is programmed)
  2371.     Side Effects:  None
  2372. }
  2373. begin
  2374.     write (fo, escape);  { send ESCAPE char }
  2375.     write (fo, '\');     { programming key }
  2376.     charout (chr(ps));   { key identifier }
  2377.     write (fo, ';');     { separator }
  2378.     print_message;       { send message }
  2379.     writeln(fo); up;     { new line to end sequence }
  2380. end;  { PROGRAM_KEYS }
  2381.  
  2382.  
  2383. procedure user_line (double : boolean);
  2384. {
  2385.     USER_LINE programs the User's Message Line on the TVI 970 with
  2386.     the string contained in MESSAGE.  If DOUBLE is TRUE, the message
  2387.     appears as double-width.
  2388.  
  2389.     Inputs:  MESSAGE (global) = string to be placed in message line
  2390.          DOUBLE = is double-width text to be output (T/F)?
  2391.     Outputs:  None (Message is stored)
  2392.     Side Effects:  None
  2393. }
  2394. begin
  2395.     write (fo, escape);   { send ESCAPE char }
  2396.     write (fo, '^');      { store User Line Message }
  2397.     if (double) then begin  { enable double-width chars }
  2398.         write (fo, ' ');  { space to position cursor }
  2399.         write (fo, escape);  { goto double-width }
  2400.         write (fo, '[5;1z');
  2401.         end;
  2402.     print_message;    { output message }
  2403.     if (double) then begin  { enable single-width chars }
  2404.         write (fo, escape);  { goto single-width }
  2405.         write (fo, '[5;0z');
  2406.         end;
  2407.     writeln(fo); up;  { new line to end sequence }
  2408. end;  { USER_LINE }
  2409.  
  2410. {----------------------------------------------------------------}
  2411. {
  2412.     3. Command Processing Routines
  2413.         PROCESS_ANSWER_BACK
  2414.         PROCESS_CURSOR_TYPE
  2415.         PROCESS_FCT_KEY
  2416.         PROCESS_KEY_CLICK
  2417.         PROCESS_LINE_TYPE
  2418.         PROCESS_OTHER_TEXT
  2419.         PROCESS_PERSONAL_MESSAGE
  2420.         PROCESS_PROGRAM_KEYS (not yet used)
  2421.         PROCESS_USER_LINE
  2422. }
  2423.  
  2424. procedure process_answer_back;
  2425. {
  2426.     PROCESS_ANSWER_BACK reads in the answer back message
  2427.     and programs the terminal with it.
  2428.  
  2429.     Inputs:  None
  2430.     Outputs:  None (message is programmed)
  2431.     Side Effects:  None
  2432. }
  2433. begin
  2434.     get_message;   { input message }
  2435.     answer_back;   { send sequence }
  2436. end;  { PROCESS_ANSWER_BACK }
  2437.  
  2438.  
  2439. procedure process_cursor_type;
  2440. {
  2441.     PROCESS_CURSOR_TYPE programs the type of cursor, as selected
  2442.     from the file input.  Syntax:
  2443.  
  2444.         Ccr
  2445.     where:
  2446.         c = B for Block (vs Underline) Cursor
  2447.         r = S for Steady (vs Blinking) Cursor
  2448. }
  2449. var
  2450.     opt : char;
  2451.     idx, ctype : integer;
  2452. begin
  2453.     ctype := 2;  { cursor is blinking underline }
  2454.     get_message; { read line into message buffer }
  2455.     idx := 1;    { 1st char }
  2456.     repeat
  2457.         opt := toupper (message[idx]);  { get next char }
  2458.         idx := idx + 1;
  2459.         case opt of
  2460.             'B' : ctype := ctype - 2;  { block cursor }
  2461.             'S' : ctype := ctype + 1;  { steady cursor }
  2462.             OTHERWISE ;                { NULL statement }
  2463.         end;  { case MESSAGE[IDX] }
  2464.     until (opt = chr(0));
  2465.     cursor (chr(ctype + ord('0')));  { set cursor }
  2466. end;  { PROCESS_CURSOR_TYPE }
  2467.  
  2468.  
  2469. procedure process_fct_key;
  2470. {
  2471.     PROCESS_FCT_KEY programs a function key.  Syntax:
  2472.         Fst n text
  2473.     where:
  2474.         s = S if fct key is shifted
  2475.         t = L if local execution of key (term only)
  2476.         n = function key number (1-16)
  2477.         text = text of key
  2478.  
  2479.     Inputs:  None
  2480.     Outputs:  None
  2481.     Side Effects:  None (Fct Key is programmed)
  2482. }
  2483. var
  2484.     shifted, xmit : boolean;
  2485.     opt : char;
  2486.     key_number : integer;
  2487. begin
  2488.     xmit := TRUE;      { default is xmit to computer }
  2489.     shifted := FALSE;  { default is not shifted fct key }
  2490.     repeat
  2491.         if EOF(infile) then stop_all
  2492.           else read (infile, opt);    { get next char }
  2493.         opt := toupper (opt);         { capitalize }
  2494.         case opt of
  2495.             'L' : xmit := FALSE;    { don't xmit to computer }
  2496.             'S' : shifted := TRUE;  { shift fct key }
  2497.             OTHERWISE ;             { NULL statement }
  2498.         end;  { case OPT }
  2499.     until (opt = ' ');
  2500.     if EOF(infile) then stop_all;
  2501.     read (infile, key_number);   { get number of key }
  2502.     if EOF(infile) then stop_all;
  2503.     read (infile, opt);          { flush following char }
  2504.     get_message;                 { input text }
  2505.     function_key (key_number, shifted, xmit);
  2506. end;  { PROCESS_FCT_KEY }
  2507.  
  2508.  
  2509. procedure process_key_click;
  2510. {
  2511.     PROCESS_KEY_CLICK turns on and off the key click.  Syntax:
  2512.         Kk
  2513.     where:
  2514.         k = Y if key click on (otherwise off)
  2515.  
  2516.     Inputs:  None
  2517.     Outputs:  None
  2518.     Side Effects:  None (key click is affected)
  2519. }
  2520. var
  2521.     click : boolean;
  2522. begin
  2523.     get_message;
  2524.     if (toupper(message[1]) = 'Y') then click := TRUE
  2525.       else click := FALSE;
  2526.     key_click (click);
  2527. end;  { PROCESS_KEY_CLICK }
  2528.  
  2529.  
  2530. procedure process_line_type;
  2531. {
  2532.     PROCESS_LINE_TYPE selects the type of line displayed at the
  2533.     25th line.  Syntax:
  2534.         Ll
  2535.     where:
  2536.         l = U if user, S if status (default is blank)
  2537.  
  2538.     Inputs:  None
  2539.     Outputs:  None
  2540.     Side Effects:  None (line is set)
  2541. }
  2542. var
  2543.     ltype : integer;
  2544. begin
  2545.     get_message;  { input text }
  2546.     case toupper(message[1]) of
  2547.         'U' : ltype := 2;
  2548.         'S' : ltype := 1;
  2549.         OTHERWISE ltype := 0;
  2550.         end;
  2551.     line_type (ltype);  { set line type }
  2552. end;  { PROCESS_LINE_TYPE }
  2553.  
  2554.  
  2555. procedure process_other_text;
  2556. {
  2557.     PROCESS_OTHER_TEXT sends the text following the command
  2558.     to the terminal with escape processing.  Syntax:
  2559.         O<text>
  2560.  
  2561.     Inputs:  None
  2562.     Outputs:  None
  2563.     Side Effects:  None (text is sent to terminal)
  2564. }
  2565. begin
  2566.     get_message;  { input text }
  2567.     other_text;   { output text }
  2568. end;  { PROCESS_OTHER_TEXT }
  2569.  
  2570.  
  2571. procedure process_personal_message;
  2572. {
  2573.     PROCESS_PERSONAL_MESSAGE programs one of the personal messages
  2574.     with a new character string.  The user is responsible for
  2575.     ensuring that the string is not too long for the message's buffer.
  2576.     Syntax:
  2577.         M n text
  2578.     where:
  2579.         n = Message Number (0 to 7)
  2580.         text = text for message
  2581.  
  2582.     Inputs:  None
  2583.     Outputs:  None
  2584.     Side Effects:  None (Message is programmed)
  2585. }
  2586. var
  2587.     opt : char;
  2588.     msg_number : integer;
  2589. begin
  2590.     if EOF(infile) then stop_all;
  2591.     read (infile, msg_number);   { get number of message }
  2592.     if EOF(infile) then stop_all;
  2593.     read (infile, opt);          { flush following char }
  2594.     get_message;                 { input text }
  2595.     personal_message (msg_number);
  2596. end;  { PROCESS_PERSONAL_MESSAGE }
  2597.  
  2598.  
  2599. procedure process_program_keys;
  2600. {
  2601.     PROCESS_PROGRAM_KEYS programs one of the programmable keys
  2602.     with a new character string.  The user is responsible for
  2603.     ensuring that the string is not too long for the key's buffer.
  2604.     Syntax:
  2605.         P n text
  2606.     where:
  2607.         n = Ps value of key (0 to 62)
  2608.         text = text for key
  2609.  
  2610.     Inputs:  None
  2611.     Outputs:  None
  2612.     Side Effects:  None (Key is programmed)
  2613. }
  2614. var
  2615.     opt : char;
  2616.     key_number : integer;
  2617. begin
  2618.     if EOF(infile) then stop_all;
  2619.     read (infile, key_number);   { get number of key }
  2620.     if EOF(infile) then stop_all;
  2621.     read (infile, opt);          { flush following char }
  2622.     get_message;                 { input text }
  2623.     program_keys (key_number);
  2624. end;  { PROCESS_PROGRAM_KEYS }
  2625.  
  2626.  
  2627. procedure process_user_line;
  2628. {
  2629.     PROCESS_USER_LINE inputs the user line and programs the terminal
  2630.     with it.  Syntax:
  2631.         U<text>
  2632.  
  2633.     Inputs:  None
  2634.     Outputs:  None
  2635.     Side Effects:  MESSAGE (global) is changed
  2636. }
  2637. begin
  2638.     get_message;  { input user line }
  2639.     user_line (FALSE);  { program line with normal width chars }
  2640. end;  { PROCESS_USER_LINE }
  2641.  
  2642.  
  2643. {----------------------------------------------------------------}
  2644. { 4. Mainline }
  2645.  
  2646. var
  2647.     cmd : char;
  2648.     fkey : integer;
  2649.     fname : str;
  2650.     prompt : prompt_str;
  2651. value
  2652.     prompt := '$_P970 Filename? ';
  2653.  
  2654. begin  { Mainline  }
  2655.     writeln ('P970 Version ', version:3:1);
  2656.     lib$get_foreign (fname, prompt);  { get file name from command line }
  2657.     open(infile, fname, OLD);         { open command file }
  2658.     reset(infile);                    { rewind command file for input }
  2659.     open(fo,'SYS$OUTPUT', NEW, 4096); { open output file }
  2660.     rewrite(fo);
  2661.     repeat
  2662.         if EOF(infile) then cmd := 'E'
  2663.           else read (infile, cmd);  { get command letter }
  2664.         cmd := toupper (cmd);       { convert to upper case }
  2665.         case cmd of
  2666.             ' ' : get_message;
  2667.             'A' : process_answer_back;
  2668.             'C' : process_cursor_type;
  2669.             'E' : cmd := 'Z';
  2670.             'F' : process_fct_key;
  2671.             'K' : process_key_click;
  2672.             'L' : process_line_type;
  2673.  
  2674. { Personal Messages Not Implemented because of error in manual }
  2675. {            'M' : process_personal_message; }
  2676.  
  2677.             'O' : process_other_text;
  2678.             'P' : process_program_keys;
  2679.             'U' : process_user_line;
  2680.             'Z' : cmd := 'Z';
  2681.             ';' : get_message;
  2682.             OTHERWISE begin
  2683.                 write ('Invalid Command: '); writeln (cmd);
  2684.                 get_message;
  2685.                 end;
  2686.         end;
  2687.     until (cmd = 'Z');
  2688. end.  { PROG970 }
  2689. ::::::::::
  2690. a970.ada
  2691. ::::::::::
  2692.  
  2693. with TEXT_IO;
  2694.  
  2695. procedure PROG970 is
  2696. -- 
  2697. --      PROG970 in Pascal, by Rick Conn
  2698. --               converted to Ada by Freeman Moore, April 1985
  2699. -- 
  2700. --      The purpose of PROG970 is to Program the TVI 970 terminal from a file,
  2701. --      setting a variety of its features.  These features include
  2702. --      the following:
  2703. -- 
  2704. --              o User Message Line
  2705. --              o Function Keys
  2706. --              o Cursor Type
  2707. --              o Key Click
  2708. --              o 25th Line Display
  2709. --              o Answerback Sequence
  2710. --              o Programmable Keys
  2711. --              o Personal Messages
  2712. --              o Other User-Definable Char Sequences
  2713. -- 
  2714. --      PROG970 is divided into three major modules and one initialization
  2715. --      and command selection mainline.  The three major modules are:
  2716. -- 
  2717. --              1. Support Routines
  2718. --                      -- provide low-level I/O et al
  2719. --                      -- routines are dependent and ordered
  2720. --              2. Routines for Terminal Output of Functions
  2721. --                      -- function-specific routines, such as
  2722. --                              program function key n with string s
  2723. --                      -- routines are independent; order is alphabetical
  2724. --                      -- routines in module 1 called for support
  2725. --              3. Command Processing Routines
  2726. --                      -- process command options and data for
  2727. --                              specific commands
  2728. --                      -- routines are independent; order is alphabetical
  2729. --                      -- routines in modules 1 and 2 called for support
  2730. -- 
  2731. -- 
  2732.  
  2733.     VERSION       : constant STRING := "1.7";   -- version number 
  2734.     SYS_OUTPUT    : constant string := "SYS$OUTPUT";  -- user's terminal
  2735.     STR_LENGTH    : constant := 255;   -- max length of strings 
  2736.     PROMPT_LENGTH : constant := 17;    -- length of prompt string 
  2737.     DELETE        : constant CHARACTER := ASCII.DEL; -- DELETE character 
  2738.     ESCAPE        : constant CHARACTER := ASCII.ESC; -- ESCAPE character 
  2739.     CR            : constant CHARACTER := ASCII.CR; -- CARRIAGE RETURN character
  2740.                                                     -- 
  2741.     NUL           : constant CHARACTER := ASCII.NUL; -- used for end of string
  2742.     LITERAL       : constant CHARACTER := '\';   -- following char is accepted
  2743.                                                  -- literally 
  2744.     CONTROL       : constant CHARACTER := '^';   -- control char is represented 
  2745.     LIT_ESC       : constant CHARACTER := 'E';   -- literal code for ESC char
  2746.                                                  -- (\E) 
  2747.     LIT_DEL       : constant CHARACTER := 'D';   -- literal code for DEL char
  2748.                                                  -- (\D) 
  2749.  
  2750.     HALT : exception;
  2751.  
  2752.     subtype STR        is STRING (1 .. STR_LENGTH);
  2753.     subtype PROMPT_STR is STRING (1 .. PROMPT_LENGTH);
  2754.  
  2755.     MESSAGE      : STR;
  2756.     INFILE       : TEXT_IO.FILE_TYPE;
  2757.     FO           : TEXT_IO.FILE_TYPE;
  2758.  
  2759.     CMD          : CHARACTER;
  2760.     FKEY         : INTEGER;
  2761.     FNAME        : STR;
  2762.     FNAME_LENGTH : INTEGER;
  2763.     PROMPT       : constant PROMPT_STR := "$_A970 Filename? ";
  2764.  
  2765.     package INT_IO is new TEXT_IO.INTEGER_IO (INTEGER);
  2766.  
  2767. ------------------------------------------------------------------
  2768. -- 
  2769. --      1. Support Routines
  2770. --              STOP_ALL
  2771. --              UP
  2772. --              TOUPPER
  2773. --              DIGOUT
  2774. --              CHAROUT
  2775. --              PRINT_MESSAGE
  2776. --              GET_MESSAGE
  2777. --              GET_CHAR
  2778. -- 
  2779.  
  2780.     procedure STOP_ALL is
  2781. -- 
  2782. --      STOP_ALL halts execution of the program when an EOF condition
  2783. --      is detected prematurely.  It prints an appropriate error message.
  2784. -- 
  2785. --      Inputs: None
  2786. --      Outputs: None
  2787. --      Side Effects: None (program is halted)
  2788. -- 
  2789.     begin
  2790.         TEXT_IO.NEW_LINE;
  2791.         TEXT_IO.PUT_LINE ("Premature End of File on Input File");
  2792.         raise HALT;
  2793.     end STOP_ALL;
  2794.  
  2795.  
  2796.     procedure UP is
  2797. -- 
  2798. --      UP moves cursor up one line so screen info is not lost by
  2799. --      running P970.
  2800. -- 
  2801. --      Inputs: None
  2802. --      Outputs: None
  2803. --      Side Effects: None (cursor moves up)
  2804. -- 
  2805.     begin
  2806.         TEXT_IO.PUT (FO, ESCAPE & 'M'); -- \E M moves cursor up one line 
  2807.     end UP;
  2808.  
  2809.  
  2810.     function TOUPPER (CH : CHARACTER) return CHARACTER is
  2811. -- 
  2812. --      TOUPPER capitalizes the input character, if necessary.
  2813. -- 
  2814. --      Inputs:  CH = char to capitalize
  2815. --      Outputs:  TOUPPER = capitalized output
  2816. --      Side Effects:  None
  2817. -- 
  2818.         TEMP_CHAR : CHARACTER;
  2819.     begin
  2820.         if (CHARACTER'POS ('a') <= CHARACTER'POS (CH)) and
  2821.            (CHARACTER'POS (CH) <= CHARACTER'POS ('z')) then
  2822.             TEMP_CHAR := CHARACTER'VAL
  2823.                            (CHARACTER'POS (CH) - CHARACTER'POS ('a') +
  2824.                             CHARACTER'POS ('A'));
  2825.         else
  2826.             TEMP_CHAR := CH;
  2827.         end if;
  2828.  
  2829.         return TEMP_CHAR;
  2830.     end TOUPPER;
  2831.  
  2832.  
  2833.     procedure CHAROUT (CH : CHARACTER) is
  2834. -- 
  2835. --      CHAROUT outputs the character to the terminal as up to three
  2836. --      ASCII digit characters.  These characters represent the ASCII
  2837. --      code value of the input character.  For example, 'A' = 65 decimal,
  2838. --      so CHAROUT('A') outputs '65'.
  2839. -- 
  2840. --      Inputs:  CH = char to output
  2841. --      Outputs:  None (digit chars are printed)
  2842. --      Side Effects:  None
  2843. -- 
  2844.         CH_VAL : INTEGER := CHARACTER'POS (CH);
  2845.     begin
  2846.  
  2847.         INT_IO.PUT (FO, CH_VAL, 1);
  2848.  
  2849.     end CHAROUT;
  2850.  
  2851.  
  2852.     procedure PRINT_MESSAGE is
  2853. -- 
  2854. --      PRINT_MESSAGE prints the message contained in the array MESSAGE
  2855. --      to the screen.
  2856. -- 
  2857. --      Inputs:  MESSAGE = string passed globally
  2858. --      Outputs:  None (string is printed)
  2859. --      Side Effects:  None
  2860. -- 
  2861.  
  2862.         CTRL, IDX : INTEGER;
  2863.  
  2864.     begin
  2865.         IDX := 1;
  2866.  
  2867.         while (MESSAGE (IDX) /= NUL) loop
  2868.             case MESSAGE (IDX) is
  2869.                 when CONTROL =>  -- control char processing 
  2870.                     IDX := IDX + 1;             -- next char 
  2871.                     CTRL := CHARACTER'POS (TOUPPER (MESSAGE (IDX))) -
  2872.                             CHARACTER'POS ('@');
  2873.                     CHAROUT (CHARACTER'VAL (CTRL));
  2874.  
  2875.                 when LITERAL =>  -- literal char follows 
  2876.                     IDX := IDX + 1;             -- next char 
  2877.                     case TOUPPER (MESSAGE (IDX)) is
  2878.                         when LIT_DEL =>  CHAROUT (DELETE);
  2879.                         when LIT_ESC =>  CHAROUT (ESCAPE);
  2880.                         when others  =>  CHAROUT (MESSAGE (IDX));
  2881.                     end case;
  2882.  
  2883.                 when others =>  CHAROUT (MESSAGE (IDX));  -- output char 
  2884.             end case;
  2885.             -- 
  2886.             IDX := IDX + 1;
  2887.  
  2888.             if (MESSAGE (IDX) /= NUL) then
  2889.                 TEXT_IO.PUT (FO, ';');                              -- separator
  2890.                                                                     -- 
  2891.             end if;
  2892.         end loop;
  2893.     end PRINT_MESSAGE;
  2894.  
  2895.  
  2896.     procedure GET_MESSAGE is
  2897. -- 
  2898. --      GET_MESSAGE clears the message buffer and reads a line
  2899. --      of text from the keyboard into it.
  2900. -- 
  2901. --      Inputs:  None (keyboard)
  2902. --      Outputs:  MESSAGE (global) = user input followed by NULLs
  2903. --      Side Effects:  None
  2904. -- 
  2905.  
  2906.         IDX : INTEGER;
  2907.     begin
  2908.         MESSAGE := (1 .. STR_LENGTH => ' ');
  2909.  
  2910.         if not TEXT_IO.END_OF_FILE (INFILE) then
  2911.             TEXT_IO.GET_LINE (INFILE, MESSAGE, IDX);
  2912.         end if;
  2913.  
  2914.         IDX := STR_LENGTH;
  2915.  
  2916.         while ((MESSAGE (IDX) = ' ') and (IDX /= 1)) loop
  2917.             MESSAGE (IDX) := NUL;     -- NULL fill at end 
  2918.             IDX := IDX - 1;
  2919.         end loop;
  2920.  
  2921.         if (MESSAGE (IDX) = LITERAL) then
  2922.             -- last char was a space 
  2923.             IDX := IDX + 1;
  2924.             MESSAGE (IDX) := ' ';
  2925.         end if;
  2926.     end GET_MESSAGE;
  2927.  
  2928.  
  2929.     function GET_CHAR return CHARACTER is
  2930. -- 
  2931. --      GET_CHAR inputs a line from the user and returns only the first
  2932. --      character of it (non-blank).
  2933. -- 
  2934. --      Inputs:  None (keyboard)
  2935. --      Outputs:  Char returned
  2936. --      Side Effects:  None
  2937. -- 
  2938.  
  2939.         MESSAGE_SAVE : STR;
  2940.         IDX          : INTEGER;
  2941.         TEMP_CHAR    : CHARACTER;
  2942.     begin
  2943.         MESSAGE_SAVE := MESSAGE;
  2944.         GET_MESSAGE;
  2945.         IDX := 1;
  2946.  
  2947.         while (MESSAGE (IDX) = ' ') loop
  2948.             IDX := IDX + 1;                             -- skip to non-blank 
  2949.         end loop;
  2950.  
  2951.         TEMP_CHAR := MESSAGE (IDX); -- set return char 
  2952.         MESSAGE := MESSAGE_SAVE;
  2953.         return TEMP_CHAR;
  2954.     end GET_CHAR;
  2955.  
  2956. ----------------------------------------------------------------
  2957. -- 
  2958. --      2. Routines for Terminal Output of Functions
  2959. --              ANSWER_BACK
  2960. --              CURSOR
  2961. --              FUNCTION_KEY
  2962. --              KEY_CLICK
  2963. --              LINE_TYPE
  2964. --              OTHER_TEXT
  2965. --              PERSONAL_MESSAGE
  2966. --              PROGRAM_KEYS (not yet used)
  2967. --              USER_LINE
  2968. -- 
  2969.  
  2970.     procedure ANSWER_BACK is
  2971. -- 
  2972. --      ANSWER_BACK programs the answer-back string with the message
  2973. --      contained in the message buffer.  It is assumed that the message
  2974. --      is 24 characters or less.
  2975. -- 
  2976. --      Inputs:  MESSAGE (global) = string to be placed in message line
  2977. --      Outputs:  None (Message is stored)
  2978. --      Side Effects:  None
  2979. -- 
  2980.     begin
  2981.         TEXT_IO.PUT (FO, ESCAPE);  -- send ESCAPE char 
  2982.         TEXT_IO.PUT (FO, "\72;");  -- store Answer Back Message 
  2983.         PRINT_MESSAGE;   -- output message 
  2984.         TEXT_IO.NEW_LINE (FO);
  2985.         UP;                       -- new line to end sequence 
  2986.     end ANSWER_BACK;
  2987.  
  2988.  
  2989.  
  2990.     procedure CURSOR (CTYPE : CHARACTER) is
  2991. -- 
  2992. --      CURSOR programs the cursor type.
  2993. -- 
  2994. --      Inputs:  CTYPE = cursor type ('0'=blinking block, '1'=steady block,
  2995. --              '2'=blinking underline, '3'=steady underline)
  2996. --      Outputs:  None (cursor is set)
  2997. --      Side Effects:  None
  2998. -- 
  2999.     begin
  3000.         TEXT_IO.PUT (FO, ESCAPE); -- ESCAPE char 
  3001.         TEXT_IO.PUT (FO, "[3;");  -- set cursor 
  3002.         TEXT_IO.PUT (FO, CTYPE);  -- cursor type 
  3003.         TEXT_IO.PUT (FO, 'z');    -- done 
  3004.     end CURSOR;
  3005.  
  3006.  
  3007.     procedure FUNCTION_KEY (KEY : INTEGER; SHIFTED, XMIT : BOOLEAN) is
  3008. -- 
  3009. --      FUNCTION_KEY programs a function key with the string contained
  3010. --      in MESSAGE.
  3011. -- 
  3012. --      Inputs:  MESSAGE (global) = message to go into function key
  3013. --               KEY = number of function key (1 to 16)
  3014. --               SHIFTED = is function key shifted (T/F)?
  3015. --               XMIT = transmit string to computer (T/F)?
  3016. --      Outputs:  None (key is programmed)
  3017. --      Side Effects:  None
  3018. -- 
  3019.     begin
  3020.         TEXT_IO.PUT (FO, ESCAPE); -- send ESCAPE char 
  3021.         TEXT_IO.PUT (FO, '|');    -- programming function key 
  3022.         if (SHIFTED) then
  3023.             CHAROUT (CHARACTER'VAL (KEY + 16));            -- shifted key number
  3024.                                                            -- 
  3025.         else
  3026.             CHAROUT (CHARACTER'VAL (KEY));   -- unshifted key number 
  3027.         end if;
  3028.  
  3029.         TEXT_IO.PUT (FO, ';');    -- separator 
  3030.         if (XMIT) then
  3031.             TEXT_IO.PUT (FO, '1');            -- full duplex - send to computer
  3032.                                               -- only 
  3033.         else
  3034.             TEXT_IO.PUT (FO, '2');   -- local 
  3035.         end if;
  3036.  
  3037.         TEXT_IO.PUT (FO, ';');    -- separator 
  3038.         PRINT_MESSAGE;      -- send message 
  3039.         TEXT_IO.NEW_LINE (FO);
  3040.         UP;                          -- new line to end sequence 
  3041.     end FUNCTION_KEY;
  3042.  
  3043.  
  3044.     procedure KEY_CLICK (CLICK : BOOLEAN) is
  3045. -- 
  3046. --      KEY_CLICK turns on the key click if CLICK is TRUE or off the
  3047. --      key click if CLICK is FALSE.
  3048. -- 
  3049. --      Inputs:  CLICK = T if key click ON, F if key click OFF
  3050. --      Outputs:  None
  3051. --      Side Effects:  None (key click is affected)
  3052. -- 
  3053.     begin
  3054.         if (CLICK) then
  3055.             -- turn on key click 
  3056.             TEXT_IO.PUT (FO, ESCAPE);
  3057.             TEXT_IO.PUT_LINE (FO, "[6;0z");
  3058.             UP;
  3059.         else
  3060.             -- turn off key click 
  3061.             TEXT_IO.PUT (FO, ESCAPE);
  3062.             TEXT_IO.PUT_LINE (FO, "[6;1z");
  3063.             UP;
  3064.         end if;
  3065.     end KEY_CLICK;
  3066.  
  3067.  
  3068.     procedure LINE_TYPE (SELECTION : INTEGER) is
  3069. -- 
  3070. --      LINE_TYPE selects the 25th line as blank, status, or user
  3071. --      message.
  3072. -- 
  3073. --      Inputs:  SELECTION = type (0=blank, 1=status, 2=user message)
  3074. --      Outputs:  None
  3075. --      Side Effects:  None (line type is selected)
  3076. -- 
  3077.     begin
  3078.         TEXT_IO.PUT (FO, ESCAPE); -- ESCAPE char 
  3079.         TEXT_IO.PUT (FO, "[0;");  -- prefix 
  3080.         TEXT_IO.PUT (FO, CHARACTER'VAL (SELECTION + CHARACTER'POS ('0'))); -- digit char '0', '1', '2' 
  3081.         TEXT_IO.PUT_LINE (FO, "z");
  3082.         UP;
  3083.     end LINE_TYPE;
  3084.  
  3085.  
  3086.     procedure OTHER_TEXT is
  3087. -- 
  3088. --      OTHER_TEXT simply echoes the text which follows the O command
  3089. --      as-is (with escape sequence processing).
  3090. -- 
  3091. --      Inputs:  None
  3092. --      Outputs:  None
  3093. --      Side Effects:  None (text is sent to terminal)
  3094. -- 
  3095.  
  3096.         IDX : INTEGER;
  3097.         CHX : CHARACTER;
  3098.     begin
  3099.         IDX := 1;
  3100.  
  3101.         loop
  3102.             case TOUPPER (MESSAGE (IDX)) is
  3103.                 when CONTROL =>  -- output control char 
  3104.                     IDX := IDX + 1;
  3105.                     CHX := TOUPPER (MESSAGE (IDX));
  3106.                     CHX := CHARACTER'VAL
  3107.                              (CHARACTER'POS (CHX) - CHARACTER'POS ('@'));
  3108.                     TEXT_IO.PUT (FO, CHX);
  3109.  
  3110.                 when LITERAL =>  -- output literal char 
  3111.                     IDX := IDX + 1;
  3112.                     CHX := MESSAGE (IDX);
  3113.  
  3114.                     case TOUPPER (CHX) is
  3115.                         when LIT_DEL =>  TEXT_IO.PUT (FO, DELETE);
  3116.                         when LIT_ESC =>  TEXT_IO.PUT (FO, ESCAPE);
  3117.                         when others  =>  TEXT_IO.PUT (FO, CHX);
  3118.                     end case;
  3119.  
  3120.                 when others =>  TEXT_IO.PUT (FO, MESSAGE (IDX));
  3121.             end case;
  3122.  
  3123.             IDX := IDX + 1;
  3124.             exit when (MESSAGE (IDX) = NUL);
  3125.         end loop;
  3126.     end OTHER_TEXT;
  3127.  
  3128.     procedure PERSONAL_MESSAGE (MSG : INTEGER) is
  3129. -- 
  3130. --      PERSONAL_MESSAGE loads a personal message into the terminal.
  3131. --      It is the user's responsibility to ensure that the personal
  3132. --      message does not exceed 9 characters in length.
  3133. -- 
  3134. --      Inputs:  MESSAGE (global) = message to go into terminal
  3135. --               MSG = Personal Message Number (0 to 7)
  3136. --      Outputs:  None (message is programmed)
  3137. --      Side Effects:  None
  3138. -- 
  3139.     begin
  3140.         TEXT_IO.PUT (FO, ESCAPE);     -- send ESCAPE char 
  3141.         TEXT_IO.PUT (FO, '^');        -- personal message 
  3142.         CHAROUT (CHARACTER'VAL (MSG + 64)); -- PS number for message 
  3143.         TEXT_IO.PUT (FO, ';');        -- separator 
  3144.         PRINT_MESSAGE;          -- send message 
  3145.         TEXT_IO.NEW_LINE (FO);
  3146.         UP;                              -- new line to end sequence 
  3147.     end PERSONAL_MESSAGE;
  3148.  
  3149.     procedure PROGRAM_KEYS (PS : INTEGER) is
  3150. -- 
  3151. --      PROGRAM_KEYS programs a user-programmable key with a character
  3152. --      sequence.  It is the programmer's responsibility to ensure that
  3153. --      no more than the maximum number of bytes allowed for a particular
  3154. --      key are transmitted into it.
  3155. -- 
  3156. --      Inputs:  MESSAGE (global) = message to go into prog key
  3157. --               PS = Ps value which identifies key
  3158. --      Outputs:  None (key is programmed)
  3159. --      Side Effects:  None
  3160. -- 
  3161.     begin
  3162.         TEXT_IO.PUT (FO, ESCAPE); -- send ESCAPE char 
  3163.         TEXT_IO.PUT (FO, '\');    -- programming key 
  3164.         CHAROUT (CHARACTER'VAL (PS)); -- key identifier 
  3165.         TEXT_IO.PUT (FO, ';');    -- separator 
  3166.         PRINT_MESSAGE;      -- send message 
  3167.         TEXT_IO.NEW_LINE (FO);
  3168.         UP;                          -- new line to end sequence 
  3169.     end PROGRAM_KEYS;
  3170.  
  3171.  
  3172.     procedure USER_LINE (DOUBLE : BOOLEAN) is
  3173. -- 
  3174. --      USER_LINE programs the User's Message Line on the TVI 970 with
  3175. --      the string contained in MESSAGE.  If DOUBLE is TRUE, the message
  3176. --      appears as double-width.
  3177. -- 
  3178. --      Inputs:  MESSAGE (global) = string to be placed in message line
  3179. --               DOUBLE = is double-width text to be output (T/F)?
  3180. --      Outputs:  None (Message is stored)
  3181. --      Side Effects:  None
  3182. -- 
  3183.     begin
  3184.         TEXT_IO.PUT (FO, ESCAPE);  -- send ESCAPE char 
  3185.         TEXT_IO.PUT (FO, '^');     -- store User Line Message 
  3186.         if (DOUBLE) then
  3187.             -- enable double-width chars 
  3188.             TEXT_IO.PUT (FO, ' ');     -- space to position cursor 
  3189.             TEXT_IO.PUT (FO, ESCAPE);     -- goto double-width 
  3190.             TEXT_IO.PUT (FO, "[5;1z");
  3191.         end if;
  3192.  
  3193.         PRINT_MESSAGE;   -- output message 
  3194.         if (DOUBLE) then
  3195.             -- enable single-width chars 
  3196.             TEXT_IO.PUT (FO, ESCAPE);     -- goto single-width 
  3197.             TEXT_IO.PUT (FO, "[5;0z");
  3198.         end if;
  3199.  
  3200.         TEXT_IO.NEW_LINE (FO);
  3201.         UP;                       -- new line to end sequence 
  3202.     end USER_LINE;
  3203.  
  3204. ------------------------------------------------------------------
  3205. -- 
  3206. --      3. Command Processing Routines
  3207. --              PROCESS_ANSWER_BACK
  3208. --              PROCESS_CURSOR_TYPE
  3209. --              PROCESS_FCT_KEY
  3210. --              PROCESS_KEY_CLICK
  3211. --              PROCESS_LINE_TYPE
  3212. --              PROCESS_OTHER_TEXT
  3213. --              PROCESS_PERSONAL_MESSAGE
  3214. --              PROCESS_PROGRAM_KEYS (not yet used)
  3215. --              PROCESS_USER_LINE
  3216. -- 
  3217.  
  3218.     procedure PROCESS_ANSWER_BACK is
  3219. -- 
  3220. --      PROCESS_ANSWER_BACK reads in the answer back message
  3221. --      and programs the terminal with it.
  3222. -- 
  3223. --      Inputs:  None
  3224. --      Outputs:  None (message is programmed)
  3225. --      Side Effects:  None
  3226. -- 
  3227.     begin
  3228.         GET_MESSAGE;  -- input message 
  3229.         ANSWER_BACK;  -- send sequence 
  3230.     end PROCESS_ANSWER_BACK;
  3231.  
  3232.  
  3233.     procedure PROCESS_CURSOR_TYPE is
  3234. -- 
  3235. --      PROCESS_CURSOR_TYPE programs the type of cursor, as selected
  3236. --      from the file input.  Syntax:
  3237. -- 
  3238. --              Ccr
  3239. --      where:
  3240. --              c = B for Block (vs Underline) Cursor
  3241. --              r = S for Steady (vs Blinking) Cursor
  3242. -- 
  3243.  
  3244.         OPT        : CHARACTER;
  3245.         IDX, CTYPE : INTEGER;
  3246.     begin
  3247.         CTYPE := 2; -- cursor is blinking underline 
  3248.         GET_MESSAGE; -- read line into message buffer 
  3249.         IDX := 1;   -- 1st char 
  3250.         loop
  3251.             OPT := TOUPPER (MESSAGE (IDX));    -- get next char 
  3252.             IDX := IDX + 1;
  3253.  
  3254.             case OPT is
  3255.                 when 'B'    =>  CTYPE := CTYPE - 2; -- block cursor 
  3256.                 when 'S'    =>  CTYPE := CTYPE + 1; -- steady cursor 
  3257.                 when others =>  null;                 -- NULL statement 
  3258.             end case;
  3259.             -- case MESSAGE(IDX) 
  3260.             exit when OPT = NUL;
  3261.         end loop;
  3262.  
  3263.         CURSOR (CHARACTER'VAL (CTYPE + CHARACTER'POS ('0'))); -- set cursor 
  3264.     end PROCESS_CURSOR_TYPE;
  3265.  
  3266.  
  3267.     procedure PROCESS_FCT_KEY is
  3268. -- 
  3269. --      PROCESS_FCT_KEY programs a function key.  Syntax:
  3270. --              Fst n text
  3271. --      where:
  3272. --              s = S if fct key is shifted
  3273. --              t = L if local execution of key (term only)
  3274. --              n = function key number (1-16)
  3275. --              text = text of key
  3276. -- 
  3277. --      Inputs:  None
  3278. --      Outputs:  None
  3279. --      Side Effects:  None (Fct Key is programmed)
  3280. -- 
  3281.  
  3282.         SHIFTED, XMIT : BOOLEAN;
  3283.         OPT           : CHARACTER;
  3284.         KEY_NUMBER    : INTEGER;
  3285.     begin
  3286.         XMIT := TRUE;     -- default is xmit to computer 
  3287.         SHIFTED := FALSE; -- default is not shifted fct key 
  3288.         loop
  3289.             if TEXT_IO.END_OF_FILE (INFILE) then
  3290.                 STOP_ALL;
  3291.             else
  3292.                 TEXT_IO.GET (INFILE, OPT);          -- get next char 
  3293.             end if;
  3294.  
  3295.             OPT := TOUPPER (OPT);            -- capitalize 
  3296.             case OPT is
  3297.                 when 'L'    =>  XMIT := FALSE;  -- don't xmit to computer 
  3298.                 when 'S'    =>  SHIFTED := TRUE; -- shift fct key 
  3299.                 when others =>  null;              -- NULL statement 
  3300.             end case;
  3301.             -- case OPT 
  3302.             exit when (OPT = ' ');
  3303.         end loop;
  3304.  
  3305.         if TEXT_IO.END_OF_FILE (INFILE) then
  3306.             STOP_ALL;
  3307.         end if;
  3308.  
  3309.         INT_IO.GET (INFILE, KEY_NUMBER);  -- get number of key 
  3310.         if TEXT_IO.END_OF_FILE (INFILE) then
  3311.             STOP_ALL;
  3312.         end if;
  3313.  
  3314.         TEXT_IO.GET (INFILE, OPT);         -- flush following char 
  3315.         GET_MESSAGE;                -- input text 
  3316.         FUNCTION_KEY (KEY_NUMBER, SHIFTED, XMIT);
  3317.     end PROCESS_FCT_KEY;
  3318.  
  3319.  
  3320.     procedure PROCESS_KEY_CLICK is
  3321. -- 
  3322. --      PROCESS_KEY_CLICK turns on and off the key click.  Syntax:
  3323. --              Kk
  3324. --      where:
  3325. --              k = Y if key click on (otherwise off)
  3326. -- 
  3327. --      Inputs:  None
  3328. --      Outputs:  None
  3329. --      Side Effects:  None (key click is affected)
  3330. -- 
  3331.  
  3332.         CLICK : BOOLEAN;
  3333.     begin
  3334.         GET_MESSAGE;
  3335.  
  3336.         if (TOUPPER (MESSAGE (1)) = 'Y') then
  3337.             CLICK := TRUE;
  3338.         else
  3339.             CLICK := FALSE;
  3340.         end if;
  3341.  
  3342.         KEY_CLICK (CLICK);
  3343.     end PROCESS_KEY_CLICK;
  3344.  
  3345.  
  3346.     procedure PROCESS_LINE_TYPE is
  3347. -- 
  3348. --      PROCESS_LINE_TYPE selects the type of line displayed at the
  3349. --      25th line.  Syntax:
  3350. --              Ll
  3351. --      where:
  3352. --              l = U if user, S if status (default is blank)
  3353. -- 
  3354. --      Inputs:  None
  3355. --      Outputs:  None
  3356. --      Side Effects:  None (line is set)
  3357. -- 
  3358.  
  3359.         LTYPE : INTEGER;
  3360.     begin
  3361.         GET_MESSAGE; -- input text 
  3362.         case TOUPPER (MESSAGE (1)) is
  3363.             when 'U'    =>  LTYPE := 2;
  3364.             when 'S'    =>  LTYPE := 1;
  3365.             when others =>  LTYPE := 0;
  3366.         end case;
  3367.  
  3368.         LINE_TYPE (LTYPE); -- set line type 
  3369.     end PROCESS_LINE_TYPE;
  3370.  
  3371.  
  3372.     procedure PROCESS_OTHER_TEXT is
  3373. -- 
  3374. --      PROCESS_OTHER_TEXT sends the text following the command
  3375. --      to the terminal with escape processing.  Syntax:
  3376. --              O<text>
  3377. -- 
  3378. --      Inputs:  None
  3379. --      Outputs:  None
  3380. --      Side Effects:  None (text is sent to terminal)
  3381. -- 
  3382.     begin
  3383.         GET_MESSAGE; -- input text 
  3384.         OTHER_TEXT;  -- output text 
  3385.     end PROCESS_OTHER_TEXT;
  3386.  
  3387.  
  3388.     procedure PROCESS_PERSONAL_MESSAGE is
  3389. -- 
  3390. --      PROCESS_PERSONAL_MESSAGE programs one of the personal messages
  3391. --      with a new character string.  The user is responsible for
  3392. --      ensuring that the string is not too long for the message's buffer.
  3393. --      Syntax:
  3394. --              M n text
  3395. --      where:
  3396. --              n = Message Number (0 to 7)
  3397. --              text = text for message
  3398. -- 
  3399. --      Inputs:  None
  3400. --      Outputs:  None
  3401. --      Side Effects:  None (Message is programmed)
  3402. -- 
  3403.  
  3404.         OPT        : CHARACTER;
  3405.         MSG_NUMBER : INTEGER;
  3406.     begin
  3407.         if TEXT_IO.END_OF_FILE (INFILE) then
  3408.             STOP_ALL;
  3409.         end if;
  3410.  
  3411.         INT_IO.GET (INFILE, MSG_NUMBER);  -- get number of message 
  3412.         if TEXT_IO.END_OF_FILE (INFILE) then
  3413.             STOP_ALL;
  3414.         end if;
  3415.  
  3416.         TEXT_IO.GET (INFILE, OPT);         -- flush following char 
  3417.         GET_MESSAGE;                -- input text 
  3418.         PERSONAL_MESSAGE (MSG_NUMBER);
  3419.     end PROCESS_PERSONAL_MESSAGE;
  3420.  
  3421.  
  3422.     procedure PROCESS_PROGRAM_KEYS is
  3423. -- 
  3424. --      PROCESS_PROGRAM_KEYS programs one of the programmable keys
  3425. --      with a new character string.  The user is responsible for
  3426. --      ensuring that the string is not too long for the key's buffer.
  3427. --      Syntax:
  3428. --              P n text
  3429. --      where:
  3430. --              n = Ps value of key (0 to 62)
  3431. --              text = text for key
  3432. -- 
  3433. --      Inputs:  None
  3434. --      Outputs:  None
  3435. --      Side Effects:  None (Key is programmed)
  3436. -- 
  3437.  
  3438.         OPT        : CHARACTER;
  3439.         KEY_NUMBER : INTEGER;
  3440.     begin
  3441.         if TEXT_IO.END_OF_FILE (INFILE) then
  3442.             STOP_ALL;
  3443.         end if;
  3444.  
  3445.         INT_IO.GET (INFILE, KEY_NUMBER);  -- get number of key 
  3446.         if TEXT_IO.END_OF_FILE (INFILE) then
  3447.             STOP_ALL;
  3448.         end if;
  3449.  
  3450.         TEXT_IO.GET (INFILE, OPT);         -- flush following char 
  3451.         GET_MESSAGE;                -- input text 
  3452.         PROGRAM_KEYS (KEY_NUMBER);
  3453.     end PROCESS_PROGRAM_KEYS;
  3454.  
  3455.  
  3456.     procedure PROCESS_USER_LINE is
  3457. -- 
  3458. --      PROCESS_USER_LINE inputs the user line and programs the terminal
  3459. --      with it.  Syntax:
  3460. --              U<text>
  3461. -- 
  3462. --      Inputs:  None
  3463. --      Outputs:  None
  3464. --      Side Effects:  MESSAGE (global) is changed
  3465. -- 
  3466.     begin
  3467.         GET_MESSAGE; -- input user line 
  3468.         USER_LINE (FALSE); -- program line with normal width chars 
  3469.     end PROCESS_USER_LINE;
  3470.  
  3471.  
  3472. ------------------------------------------------------------------
  3473. -- 4. Mainline 
  3474.  
  3475. begin
  3476.     -- Mainline  
  3477.     TEXT_IO.PUT_LINE ("P970 Version " & VERSION);
  3478.     TEXT_IO.PUT (PROMPT);
  3479.     TEXT_IO.GET_LINE (FNAME, FNAME_LENGTH);
  3480. -- open command file 
  3481.     TEXT_IO.OPEN (INFILE, TEXT_IO.IN_FILE, FNAME (1 .. FNAME_LENGTH));
  3482.     TEXT_IO.CREATE (FO, TEXT_IO.OUT_FILE, SYS_OUTPUT);   -- open output file 
  3483.  
  3484.     loop
  3485.         if TEXT_IO.END_OF_FILE (INFILE) then
  3486.             CMD := 'E';
  3487.         else
  3488.             TEXT_IO.GET (INFILE, CMD);            -- get command letter 
  3489.         end if;
  3490.  
  3491.         CMD := TOUPPER (CMD);              -- convert to upper case 
  3492.         case CMD is
  3493.             when ' ' =>  GET_MESSAGE;
  3494.  
  3495.             when 'A' =>  PROCESS_ANSWER_BACK;
  3496.  
  3497.             when 'C' =>  PROCESS_CURSOR_TYPE;
  3498.  
  3499.             when 'E' =>  CMD := 'Z';
  3500.  
  3501.             when 'F' =>  PROCESS_FCT_KEY;
  3502.  
  3503.             when 'K' =>  PROCESS_KEY_CLICK;
  3504.  
  3505.             when 'L' =>  PROCESS_LINE_TYPE;
  3506.  
  3507. -- Personal Messages Not Implemented because of error in manual 
  3508. --                      'M' => process_personal_message; 
  3509.  
  3510.             when 'O' =>  PROCESS_OTHER_TEXT;
  3511.  
  3512.             when 'P' =>  PROCESS_PROGRAM_KEYS;
  3513.  
  3514.             when 'U' =>  PROCESS_USER_LINE;
  3515.  
  3516.             when 'Z' =>  CMD := 'Z';
  3517.  
  3518.             when ';' =>  GET_MESSAGE;
  3519.  
  3520.             when others => 
  3521.                 TEXT_IO.PUT ("Invalid Command: ");
  3522.                 TEXT_IO.PUT (CMD);
  3523.                 TEXT_IO.NEW_LINE;
  3524.                 GET_MESSAGE;
  3525.         end case;
  3526.  
  3527.         exit when (CMD = 'Z');
  3528.     end loop;
  3529.  
  3530.     exception
  3531.         when HALT =>
  3532.             null;
  3533. end PROG970;
  3534.