home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / enterprs / cpm / utils / a / encode6.arc / ENCODE.DOC < prev    next >
Encoding:
Text File  |  1990-07-22  |  13.0 KB  |  347 lines

  1.         ENCODE CP/M Version 1.06  3/2/86
  2.  
  3.         Copyright (C) 1985,1986 by Merlin R. Null
  4.  
  5.  
  6. ENCODE  is a pseudo compiler for  dBASE II  version 2.4 or higher
  7. command files.   Programs  encoded  with ENCODE will run with the
  8. regular version of dBASE II version 2.4 or higher.  Ashton-Tate's
  9. RUNTIME is not required, although it could be  used.   RUNTIME is
  10. simply an amputated version of dBASE II that only has the ability
  11. to run programs, not edit them.
  12.  
  13.  
  14.     The ENCODE library should contain the following files:
  15.  
  16. ENCODE.COM    ENCODE, pseudo compiles dBASE II command files
  17.         to run up to 30% faster.
  18. ENCODE.BAS    The MBASIC source for the above program.
  19. ENCODE.HLP    Help file for ENCODE.
  20. ENCODE.DOC    This documentation.
  21. ENCODE.CRC    CRC and other stats on ENCODE6.LBR
  22.  
  23. ************    ENCODE.COM  is  a  stand  alone  compiled  MBASIC
  24. *   NOTE   *    program.   BRUN.COM, the Microsoft compiled basic
  25. ************    runtime  package  is  NOT  required.   ENCODE.BAS
  26.         requires the  MBASIC  interpreter  to  run.   The
  27.         compiled version is in 8080 code.   It should run
  28.         on most 8080 or Z80 machines,  provided your  TPA
  29.         is 52K or greater.   If it is less, you will have
  30.         to  recompile  ENCODE.BAS  or  run  it  under the
  31.         MBASIC interpreter.
  32.  
  33.  
  34.               Installation
  35.  
  36. To install ENCODE, just run the program.   It is self installing.
  37. If the clear screen  data file,  CLS.DAT,  is missing on the disk
  38. with ENCODE, a new one will be  generated.  You will be asked for
  39. the decimal values of your clear screen sequence.   For  example,
  40. on a KayPro or Osborne CP/M machine just enter:
  41.  
  42. Clear screen character 1? 26
  43. Clear screen character 2? <RETURN>
  44.  
  45. CLS.DAT will  then  be  written  and  you  will  go  directly  to
  46. operation of ENCODE.  If the title screen is preceeded by a clear
  47. screen, the installation was  successful.  If  the  title  screen
  48. scrolls on, it failed.   If it fails,  exit  the  program,  erase
  49. CLS.DAT, and run ENCODE again. If you don't like the clear screen
  50. function, simply enter  10  when  asked  for  your  clear  screen
  51. sequence.   For each 10 you enter ENCODE will scroll one line  in
  52. place of the clear screen.   My  older  program,  CLEARSET,  will
  53. still generate a correct CLS.DAT for this version of ENCODE.
  54.  
  55.  
  56.            Calling a Directory Listing
  57.  
  58. To call a  directory from the title screen simply enter the drive
  59. you wish to list.
  60.  
  61. Filename.[SRC] or Drive:? A:
  62.  
  63. This will list the directory of  drive  A  and  give  the  prompt
  64. again.
  65.  
  66. Directory of drive A:
  67. FOO    .CMD    DBSOURCE.BAS    DBSOURCE.COM    TEST2    .CMD    A10    .CMD
  68. ENCODE  .BAS    ENCODE  .COM    MBASIC    .COM    D    .COM    SAMPLE    .CMD
  69. BOOKS    .DBF    BOOKS    .FRM    DBASE    .COM    CLS    .DAT    CLEARSET.BAS
  70. CLEARSET.COM    DBASEMSG.TXT    DBASEOVR.COM    B4    .CMD    R2D2    .CMD
  71. DBINDENT.BAS    DBINDENT.COM    ELIZA    .BAS    A10    .SRC    A10    .BAK
  72. CLONE    .CMD    TEST    .CMD    CLONE    .SRC    A10    .OLD    DBSRC2    .BAS
  73. DBSRC2    .COM
  74. Filename.[SRC] or Drive:?
  75.  
  76. The ZCPR like drive call  of  A;  will  also  work  to  call  the
  77. directory, even if you are not running  ZCPR.   The  Filename.CMD
  78. may be entered here  or  a  <RETURN>  will  redisplay  the  start
  79. screen.
  80.  
  81.  
  82.              Encoding a File
  83.  
  84. A file to be encoded MUST have the extension .SRC.  This protects
  85. your source file from being overwritten.  Just rename your source
  86. file to <filename>.SRC.  Then enter the  <filename>.[SRC]  at the
  87. ENCODE prompt.  The use of the  extension  .SRC  at the prompt is
  88. optional.
  89.  
  90. Filename.[SRC] or Drive:? SAMPLE.SRC
  91.  
  92. ENCODE requires all characters in the input file have the 8th bit
  93. set low.   You  might  have  to  run  your  source file through a
  94. filter, like UNSOFT.
  95.  
  96. ENCODE creates a partially tokenized file that can not be  listed
  97. with anything but DBSOURCE or a commercial  decoder.   It is also
  98. hard to modify a command file protected with ENCODE.  The file is
  99. reduced in size as all indenting and  comments  preceded by * are
  100. removed.   In addition comments  after  the  END  statements  are
  101. removed.  Example:
  102.  
  103. ENDIF .NOT. green
  104.  
  105. Becomes a single byte for the reserved word  ENDIF.   The  ".NOT.
  106. green" is purely a comment that repeats the conditions that began
  107. the IF statement that should read:
  108.  
  109. IF .NOT. green
  110.  
  111. Such comments make a program easier to read but  will  slow  down
  112. operation as dBASE II reads program lines from the disk  as  they
  113. are executed.  The latest versions of Ashton-Tate's DBCODE that I
  114. have seen leave these comments in.
  115.  
  116. You can label a file by enclosing a  message   between  TEXT  and
  117. ENDTEXT.  This leaves all lines between TEXT  and  ENDTEXT  as in
  118. the source file.  ENDTEXT may be abbreviated to  ENDT.   Example:
  119.  
  120. TEXT
  121.         (C) 1985 by Croggle Software, Inc.
  122. ENDTEXT
  123.  
  124. Caution should be taken that the ENDTEXT (or ENDT)  is  included.
  125. If omitted, all of the  remaining file will not be encoded.   The
  126. command TEXT shuts off  encoding,  ENDTEXT  turns  it  on  again.
  127. Indentation within the  TEXT  area  will be left as in the source
  128. file.  Use this feature as little as you can.   The  extra  lines
  129. will slow down the program a little for each line added.
  130.  
  131. ENCODE  also requires that you name  the  source  file  with  the
  132. extension .SRC.   This  keeps  the  programmer from mistaking the
  133. pseudo compiled (.CMD) file for the  source  (.SRC)  file.   If a
  134. file is requested and the .CMD file already exists,  you  will be
  135. warned:
  136.  
  137.             []=========[]
  138.             [] WARNING []
  139.             []=========[]
  140.  
  141.  
  142. SAMPLE.CMD already exists!  If you answer NO, the old SAMPLE.CMD
  143. will be renamed to SAMPLE.OLD
  144.  
  145.  
  146. Do you wish to overwrite SAMPLE.CMD (Yes/No/Quit)?
  147.  
  148. If you choose not to overwrite SAMPLE.CMD, the old file  will  be
  149. renamed  SAMPLE.OLD.   The  .OLD extension is used  to  keep  the
  150. encoded backup  files distinct from the source backup which would
  151. have a .BAK extension.  The quit option exits to CP/M.
  152.  
  153.  
  154.               Macro Support
  155.  
  156. Unlike Ashton-Tate's DBCODE,  ENCODE provides full macro support.
  157. It is  recommended  that macros be used only when other means are
  158. not  available.   Macro  operation  is  usually  slower.   A line
  159. starting  with a macro will not be  encoded.   This will slow the
  160. program even  more.   You must retain the "&" as the macro symbol
  161. if you want to  start a line  with  a  macro.   ENCODE  will  not
  162. recognize a different symbol at the  start  of  a  line,  even if
  163. dBASE II can be configured to do so.   If macros are  confined to
  164. locations other than the start of a line, the "&" may be changed.
  165. If you do plan on using ENCODE to create a file for Ashton-Tate's
  166. RUNTIME, do not use an initial macro.   RUNTIME  will  not accept
  167. it.
  168.  
  169.  
  170.                 Sub Files
  171.  
  172. ENCODE requires separate encoding of any sub files  you  wish  to
  173. use in a dBASE II program  package.   It is not required that all
  174. sub programs be encoded when operation is with  dBASE II,  but it
  175. should be done for  speed.   Only  the  command  files  with  the
  176. extension .CMD are encoded.
  177.  
  178.  
  179.                Continuation Lines
  180.  
  181. Continuation  lines  will  be  work  with  ENCODE,  but  are  not
  182. recommended.   They tend to add extra bytes  to  the  file.   The
  183. usual reason for the broken line  is  to  handle  80  columns  of
  184. display.  A pair of lines like the following:
  185.  
  186. @ 6,0 SAY '-----------------------------------------------------------------';
  187. +'---------------'
  188.  
  189. Could be written:
  190.  
  191. @ 6,0 SAY '-------------------------------------------------------------------
  192. -------------'
  193.  
  194. The line is allowed  to wrap (without a <RETURN>)  and be  longer
  195. than 80 columns.   This  is  only  possible  if  you  use  a word
  196. processor to generate the command file.   dBASE II  will amputate
  197. the lines at 80  columns.   This  method  produces  the  shortest
  198. output. Another way to handle it is as follows:
  199.  
  200. @ 6,0 SAY '----------------------------------------'
  201. @ 6,40 SAY '----------------------------------------'
  202.  
  203. This is 14 bytes longer than the previous example  and  11  bytes
  204. longer than the first, when encoded.
  205.  
  206.  
  207.            Abbreviated Reserved Words
  208.  
  209.    Reserved words may be abbreviated to four letters in your
  210. source file.  For example:
  211.  
  212. DO WHIL    =    DO WHILE
  213. OTHE    =    OTHERWISE
  214. STOR    =    STORE
  215. ENDI    =    ENDIF
  216.  
  217. This produces a source file that is a little harder to read,  but
  218. it allows faster code writing.  You may also want to encode files
  219. already written in this style.   It is  often  used  to produce a
  220. dBASE II command file that will run  slightly  faster  because of
  221. the shorter length of the file.   There  is  no gain in ENCODE to
  222. abbreviate the  initial  reserved  word  in  each  line.   ENCODE
  223. converts it to a single byte token anyway.  Please note that only
  224. the full reserved word  and  the  four  letter  abbreviation  are
  225. supported  by  ENCODE  for  initial  reserved  words.   OTHE  for
  226. OTHERWISE is ok, but OTHER or OTHERW will not work.
  227.  
  228. You can gain a little more speed from encoded  files  by  running
  229. them through a  compression  program  like  DBSQUASH  or DTUNE to
  230. remove extra spaces  and abbreviate reserved words prior to using
  231. ENCODE.   The  removal of indentation and abbreviation of initial
  232. reserved words  that these programs do will not do anything extra
  233. for ENCODE.   The  only  gain  is in the abbreviation of reserved
  234. words  after the start of the line and removal of extra  internal
  235. spaces.
  236.  
  237.  
  238.                 Help File
  239.  
  240. The help file may be called from ENCODE by entering a  "?" at the
  241. title screen.
  242.  
  243. Filename.[SRC] or Drive:? ?
  244.  
  245. Or by entering "ENCODE ?" at the CP/M command line.
  246.  
  247.  
  248.                  Option
  249.  
  250. N    No console display of  input  file.   This  is  the  only
  251. option.  The N option must preceded by a space:
  252.  
  253. Filename.[SRC] or Drive:? SAMPLE.SRC N
  254.  
  255.  
  256.                  MS-DOS
  257.  
  258. Although the CP/M  version  of  ENCODE.COM  will  not  run  under
  259. MS-DOS, most encoded command files will run with a 16 bit version
  260. of dBASE II.   They  will  not  run uner dBASE III or  BASE III+.  
  261. Not all dBASE programs written under CP/M will run under  MS-DOS.
  262. As with  any  high  level  language,  it  is  possible  to  write
  263. operating system specific code or machine specific code.
  264.  
  265.  
  266.                  History
  267.  
  268. Rev. 1.06  3/2/86    Added CP/M command line input of filename to
  269. encode.  Spaces or tabs now allowed for on otherwise blank lines. 
  270. Made the extension .SRC the default.
  271.  
  272. Rev. 1.05  3/20/85    Fixed bug that doubled  encoded  bytes  for
  273. reserved words with a length of  4.   WAIT was encoded to WAIT =.
  274. In hex:  C2 C2.  Bug present from version 1.02 thru 1.04.
  275.  
  276. Rev. 1.04  2/28/85    Minor correction to  installation  routine.
  277.  
  278. Rev. 1.03  2/27/85    Changed to remove  comments  starting  with
  279. NOTE and fixed bug in abbreviations of DO WHILE and DO CASE.
  280.  
  281. Rev. 1.02  2/24/85    Added the ability to recognize  four letter
  282. abbreviations of  initial  reserved  words.   Clear  screen  self
  283. installation added.   ENCODE.COM distributed as a stand alone COM
  284. file, BRUN.COM no longer required.
  285.  
  286. Rev. 1.01  2/17/85    Modified for compatibility with MBASIC 5.20
  287. under Apple CP/M.   This required changing TEXT$ to TXT$  as TEXT
  288. is a reserved word in the  Apple CP/M basic.   Added the  ability
  289. to accept initial reserved  words in lower case.   Also  modified
  290. to handle continuation lines and remove indentation at the  start
  291. of the continued line.  Blank lines  will  no  longer  abort  the
  292. encoding, provided they contain no spaces or tabs.
  293.  
  294. ENCODE version 1.00 released 1/6/85
  295.  
  296.  
  297.               LEGAL NOTICE
  298.  
  299. ENCODE is NOT "Public Domain."  Copyright is held by the author:
  300.  
  301.                 Merlin R. Null
  302.                 P. O. Box 9422
  303.                 N. Hollywood, CA 91609
  304.                 (818) 762-1429
  305.  
  306. Permission is given only for private,  nonprofit  use of  ENCODE.
  307. Feel free to make copies of the program for your own use  or  for
  308. your friends.  However, ENCODE may  NOT  be sold or included with
  309. any collection of programs for sale or  used as an  inducement to
  310. buy another product or program without the written  permission of
  311. the author.   Permission is also  given  for  nonprofit  computer
  312. clubs to include this program  in  distribution  disks,  provided
  313. total charges for  the  entire  disk  of  programs,  copying  and
  314. shipping do not exceed $20.00.   My  vote of thanks goes to those
  315. clubs that have kept their charges under $10.00.
  316.  
  317.  
  318.                 Donation
  319.  
  320. If you like the program and use it, a  small  donation  of  about
  321. $10.00  would  be  appreciated,  though it is not required to use
  322. ENCODE.  I will do my part to keep ENCODE maintained.
  323.  
  324. Please report any bugs to  me  at  the  above  address  or  phone
  325. number.   I can also be reached  by  leaving  a  message  on  the
  326. Glendale Literaria RCP/M (818) 956-6164.
  327.  
  328.  
  329.               Other dBASE Utilities
  330.  
  331. I have two other programs that may be  of  interest  to  dBASE II
  332. users.   They are: DBSOURCE, a program to return encoded dBASE II
  333. command files to source code.   And  DBINDENT, to pretty print or
  334. filter dBASE II source code.  The current versions as of the date
  335. of this release are in DBSRC102.LBR and DBINDNT1.LBR.
  336.  
  337. MBASIC and BRUN are Trademarks of Microsoft.
  338. dBASE II,  dBASE III,  dBASE III+,  DBCODE  and  RUNTIME  are
  339. Trademarks of Ashton-Tate.
  340. CP/M is a Trademark of Digital Research
  341. 20.00.   My  vote of thanks goes to those
  342. clubs that have kept their charges under $10.00.
  343.  
  344.  
  345.                 Donation
  346.  
  347. If you