home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / EDITOR / ZDE16.LBR / ZDKCOM13.DZC / ZDKCOM13.DOC
Text File  |  1990-06-01  |  10KB  |  209 lines

  1.  
  2.                               ZDKCOM
  3.   
  4.                     Key File Compiler for ZDE
  5.  
  6.                      Version 1.3   01 Jun 90
  7.  
  8.   ZDKCOM and its documentation are adapted with permission from 
  9.   VDKCOM12.LBR, by Fred Haines, Glendale Littera RCPM/QBBS, 818 
  10.   956-6164.  VDKCOM version 1.2 is copyright 1988 by Fred Haines, 
  11.   and is released by the author to the CP/M community for all 
  12.   reasonable noncommercial purposes.  For the Z80 source code to 
  13.   ZDKCOM, see ZDKCOM13.LBR.
  14.  
  15.  
  16.                              CONTENTS
  17.  
  18.                     1.  How to Use ZDKCOM.
  19.                     2.  Programmer's Note.
  20.  
  21.  
  22. 1.  How to Use ZDKCOM.
  23.  
  24.      ZDKCOM compiles an ASCII text file into a *.ZDK file of key 
  25. macros which ZDENSTAL will install in ZDE.  It alsos convert an 
  26. existing ZDK file into a text file with the extension ZDT.  It 
  27. allows you to create, edit, and re-edit complicated key macros 
  28. with a full-featured word processor - ZDE itself - instead of the 
  29. backspace-only line editor in ZDENSTAL.  The syntax is:
  30.  
  31.  ZDKCOM <ufn>.ZDT
  32.    converts text file to ZDK overlay
  33.  
  34.  ZDKCOM <ufn>.ZDK
  35.    converts overlay to ZDT text file  
  36.  
  37.      Use ZDE in NONDOCUMENT mode to type a file that looks like 
  38. what you see when you use the K option of ZDENSTAL, substituting 
  39. lower case "n" or "q" for the No Repeat and Quiet option 
  40. indicators <N> and <Q>:
  41.  
  42.   qThis line would be for key 0 in Quiet mode.^M
  43.   nThis line would be for key 1 in No Repeat mode.^M
  44.  
  45.   This line would be key 3, with key 2 unassigned.
  46.   n<This line would appear in angle brackets.>^M^M^M
  47.   The line above, key 4, prints with two blank lines following it.
  48.   q"This is in quotes, but no carriage return at the end."
  49.   "This line is ^P^BMacro Key 7^P^B with embedded boldface codes."^M
  50.   q^VThis line turns insert on before printing the line.^A^A^A^A_^F^D_^M
  51.   n <Key 9 not installed>^A^A^A^A
  52.  
  53. ...and so on.  Lines correspond to the number keys in 0 to 9 
  54. order, with blank lines for unassigned keys.  Do NOT embed control 
  55. codes.  Type everything in ASCII.  For instance, to underline, 
  56. type out '^P^Swords underlined^P^S'.  It's a good idea to make 
  57. hard carriage returns visible by toggling them on with the ^OD 
  58. command.  ZDKCOM accepts trailing spaces as part of the macro, 
  59. even though you can't see them, so, if you don't want them, make 
  60. sure each line is terminated by a hard carriage return.
  61.      Individual key macro strings may not exceed 127 bytes in the 
  62. ZDK file, though they may in the ZDT text file, since ASCII 
  63. representations of single-byte control codes require two bytes, 
  64. and option flags and slashes don't contribute to the length of the 
  65. string.
  66.      The total of all strings may not exceed 498 output bytes.  
  67. This is two bytes less than allowed by ZDE and ZDENSTAL, but, 
  68. under the program's present logic, it would require an inordinate 
  69. amount of code to make those last two bytes available.  If you 
  70. really need them, add them to the ZDK file with ZPATCH or any 
  71. other patcher, locate the last string-length byte, and add 2 (in 
  72. hex) to it.
  73.      For a quick demo, remove the leading spaces from the lines 
  74. below, mark them as a block, and write them out to <ufn>.ZDT.  Run 
  75. ZDKCOM <ufn>.ZDT.  Then load the resulting ZDK file into ZDE with 
  76. the command ZDENSTAL ZDE <ufn>.ZDK.
  77.  
  78.   q^C^C^C^E^E^E^E^E^[^E
  79.   q^[b^[0^Qs^X^[=^M1^[= 1^S^V ^D^[!0^[1^Qb^B^Ku
  80.   ^[=^M0^V^I^V^B^G^[![^[0^X
  81.   ^[=^M0^T^B^N^[0^X
  82.   q^P^[^P^I^P^K^P^[9
  83.   q^V^KrA0:LH.FMT^M
  84.   q^G^G^G^G^X
  85.   q<not installed>^A^A^S
  86.   q<not installed>^A^A^S
  87.   q^KrHEADER^M
  88.  
  89. Key macro 0 measures off one full page if the top margin is 0 and 
  90. the page length is 58 lines.  Adjust for different page lengths by 
  91. adding or subtracting ^E's.  I use this macro to move from line 1 
  92. of a page to line 1 of the next page.  I then use key macro 9 to 
  93. read in a page header from a separate file that contains nothing 
  94. but the properly spaced header text with a # in place of the page 
  95. number.  I search for # with a ^Qf and replace it with the 
  96. appropriate page numbers.
  97.      This happens so quickly on a 9 mhz SB180 with hard disk that 
  98. it is virtually unnoticeable, but there is a faster way to do it.  
  99. Just make up a header at the top of the first page, or, if you 
  100. want to start page headers only on page two, at the foot of the 
  101. file, and mark it as a block.  Use key macro 0 to move from the 
  102. top line of a page to the top line of the next, and copy the 
  103. header into place with the ^KC command.  Don't forget to erase the 
  104. original of the header at the foot of the file when you get there.
  105.      Key macro 1 softens and reforms a paragraph by removing the 
  106. hard carriage returns from the ends of each line.
  107.      Key macro 2 changes a document in flush left block format 
  108. (like this one) to indented paragraph form, and key macro 3 
  109. changes it back again.
  110.      Key macro 4 embeds my DIABLO 1610-compatible printer's code 
  111. for setting a left margin in column 11 (^K=0Bh) in the document.  
  112. If I want another margin I add or subtract from 0Bh and overwrite 
  113. the ^K with the appropriate control character.  You may well be 
  114. able to substitute your own printer's set left margin code for 
  115. this one.
  116.      Key macro 5 reads in a previously prepared letterhead stored 
  117. as LH.FMT on drive/user A0.
  118.      Key macro 6 removes four spaces or characters from the 
  119. beginning of each line, used to remove line numbers from the 
  120. beginnings of messages in modem capture files.
  121.  
  122.  
  123. 2.  Programmer's Note.
  124.  
  125.      A ZDK file is a data structure four records long.  The first 
  126. two bytes are an ID number which ZDENSTAL checks to ensure that it 
  127. is working with the correct version.  The current number, 0250h, 
  128. is valid for several recent versions of ZDE.
  129.      These two bytes are followed by up to ten strings, each 
  130. preceded by a string-length byte which ZDE uses to index the 
  131. string's location.  Each string is limited by the size of a buffer 
  132. in ZDE to 127 bytes.
  133.      An empty string is indicated by a string-length byte of 00h.  
  134. After the last byte of the last string, the remainder of the 512 
  135. bytes are filled with 00h.
  136.      It is a peculiarity of ZDKCOM that it needs to write two null 
  137. bytes at the end of the file, which means that it will accept only 
  138. 498 bytes for the total length of all strings (512, less two ID 
  139. bytes, less 10 string-length bytes, less these two more) rather 
  140. than the 500 that ZDE and ZDENSTAL allow.
  141.      When you look at the key macro buffer of ZDE using the K 
  142. option of ZDENSTAL, you see something that looks like this:
  143.  
  144.   <0><Q>This line would be for key 0 in Quiet mode.^M
  145.   <1><N>This line would be for key 1 in No Repeat mode.^M
  146.   <2><>
  147.   <3>This line would be key 3, with key 2 unassigned.
  148.   <4><N><This line would appear in angle brackets.>^M^M^M
  149.   <5>The line above, key 4, prints with two blank lines following it.
  150.   <6><Q>"This is in quotes, but no carriage return at the end."
  151.   <7>"This line is ^P^BMacro Key 7^P^B with embedded boldface codes."^M
  152.   <8><>
  153.   <9><>
  154.  
  155. The numbers down the side and the option indicators <N>, <Q>, and 
  156. <> (no option) are supplied by ZDENSTAL.  The ZDT text file 
  157. version of the same macro keys would omit the string numbers and 
  158. no option indicators, and convert the <N> and <Q> to simple lower 
  159. case 'n' and 'q'.  If you need lower case 'n' or 'q' as the first 
  160. character of a key macro, just precede it with a slash, which will 
  161. be ignored.
  162.      ZDKCOM recognizes blank lines as unassigned keys.  These 
  163. produce an "error" message when invoked by ZDE.
  164.      ZDE recognizes a No Repeat option if the the high bit is set 
  165. on the first byte of the macro string after the length byte, and a 
  166. Quiet option if the high bit is set on both of the first two bytes 
  167. of the string.
  168.      The translation procedure from text to overlay requires:
  169.  
  170.   Enter two-byte ID string 02h 50h in output file.
  171.  
  172.   Enter 00h to save a place for a string length byte.
  173.  
  174.   Check for "n" or "q" as first three bytes of new string and add 
  175.   80h to the next byte or next two bytes input as required.
  176.  
  177.   Read in the rest of the string byte by byte and output each byte 
  178.   to the output file.  If "^" appears in the string, drop it and 
  179.   subtract 40h from next byte to make it into a real control 
  180.   character.  If "/" appears, ignore it and print the next 
  181.   character literally.  "/^" prints "^" rather than turn the 
  182.   character following the carat into a control code, and "//" 
  183.   prints a single slash.  A single input slash is ignored.
  184.  
  185.   When the CRLF pair is encountered in the input text file, 
  186.   convert it to a 00h place marker for the length of the next 
  187.   string.  Get the number of bytes output in the last string and 
  188.   write it to the position of the string-length byte at the head 
  189.   of the preceding string.
  190.  
  191.   When the text file's ^Z EOF is encountered, fill the remainder 
  192.   of the total 512 bytes with 00h and close the files.
  193.  
  194. When converting ZDK overlays to ZDT text files, the procedure is 
  195. more or less reversed.  ZDKCOM converts the string length bytes to 
  196. CRLF pairs, the control code bytes to two-byte ASCII strings '^c', 
  197. and finishes off the file when all strings are accounted for by 
  198. inserting an EOF ^Z.
  199.      In addition, ZDKCOM has error checking for file opening and 
  200. closing and for individual and overall string length, and it 
  201. reports activity to keep the user from thinking the program has 
  202. hung, though the counters on the screen are otherwise meaningless.
  203.      The structure of the four-sector ZDK file in CP/M is so 
  204. similar to the eight-sector MS/DOS version that you can use 
  205. ZDKCOM, along with a patcher, to create a VDK file for 
  206. installation in VDE12, the MS/DOS version of ZDE.  Make up the ZDT 
  207. file as you would for CP/M, then patch the second ID byte from 50h 
  208. to 60h and add four records of nulls.
  209.