home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / jsage / zsus / z3help / z.lbr / ZDKCOM.HZP / ZDKCOM.HLP
Encoding:
Text File  |  1991-11-18  |  9.9 KB  |  228 lines

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