home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / sigm / vol240 / ecce.doc < prev    next >
Encoding:
Text File  |  1986-02-13  |  25.3 KB  |  716 lines

  1.  
  2.  
  3.             ECCE   -   Z80 CP/M Version by J.M. and J.Palmer
  4.             ------------------------------------------------
  5.  
  6. Index
  7. -----
  8.  
  9.     1     Introduction
  10.     2     Calling the Editor
  11.     3     Commands
  12.     3.1   Basic Commands
  13.     3.2   Special Commands and Macros
  14.     3.3   More on Basic Commands
  15.     3.4   More on Special Commands
  16.     3.5   More on Macros
  17.     4     Sample ECCE session
  18.     5     Gruesome Details
  19.  
  20. 1   Introduction
  21.     ------------
  22.  
  23.    ECCE  is  the  Edinburgh  Compatible  Context  Editor.    It   is   a
  24. particularly  versatile  line  oriented editor developed by Hamish Dewar
  25. and colleagues on the staff of the Department of Computer Science at the
  26. University of Edinburgh.   It is in extensive use at the University  and
  27. the  nearby  research  community,  where  it  is  mounted  on  two large
  28. mainframes in the ICL 2900 series, on the Computer Science  Department's
  29. VAX 11/780, and on many mini computers.
  30.  
  31.    Its outstanding features are:
  32.  
  33.       * It can handle files of any length, though the user can only
  34.         move backwards through text that is still in memory.
  35.  
  36.       * Text  can  be  taken  from other files by declaring them as
  37.         "Secondary" files
  38.  
  39.       * It  can  be  given  conditional  sequences   of   commands,
  40.         equivalent   to   "IF   (condition   X  is  true)  THEN  DO
  41.         (consequence A) ELSE IF (condition  X  is  false)  THEN  DO
  42.         (consequence B)", and these can be nested if required
  43.  
  44.       * Sequences  of  commands  can be defined as macros which can
  45.         then be invoked by their single-letter names.
  46.  
  47.    Thus whatever the user's specialised requirements,  whether  they  be
  48. say  word  processing  or  table  creation,  ECCE  can usually be easily
  49. adapted to provide them.
  50.  
  51.    This CP/M version of ECCE was  translated  from  IMP,  the  Edinburgh
  52. environment  implementation  language  and  a  development  of ALGOL, to
  53. PASCAL intended for compilation  by  HISOFT  PASCAL  4D.   The  run-time
  54. routines are therefore copyright.   Some parts which subsequently proved
  55. to be slow in  execution  were  rewritten  in  Z80  assembler  code  and
  56. implanted.   Some extensions to Standard ECCE have been incorporated: in
  57. the main these substitute for services normally available externally  in
  58. Edinburgh-style operating systems.
  59.  
  60.    The extensions to ECCE are
  61.  
  62.       * Once  defined,  macros  can  be  preserved  in a named or a
  63.         default file.   If the default file is used then the macros
  64.         will  be  recalled  automatically  whenever  ECCE is called
  65.         subsequently.   If a named file is  used  then  it  can  be
  66.         recalled  at  any  time  to insert the definitions which it
  67.         contains.   Thus the user can accumulate groups of  complex
  68.         macros and apply them rapidly when wanted.
  69.  
  70.       * The  command ECCE without parameters will resume editing of
  71.         the output file from the previous session.
  72.  
  73.       * A backup command can be invoked to make a copy of the  work
  74.         done so far in the current session.
  75.  
  76.       * A  command string can be aborted from the keyboard part way
  77.         through its execution.
  78.  
  79.       * The session can be aborted and the file left unaltered.
  80.  
  81.  
  82. 2   Calling the Editor
  83.     ------------------
  84.  
  85.  
  86.    There are five modes of calling ECCE summarised below:-
  87.  
  88.     1) ECCE .N <filename>             - create file <filename>
  89.     2) ECCE <filename1> <filename2>   - edit <filename1> to  <filename2>
  90.     3) ECCE <filename>                - edit  <filename>  to a temporary
  91.                                         file; when the edit  is  closed,
  92.                                         the  original file is renamed as
  93.                                         a BAK file,  and  the  temporary
  94.                                         file  is renamed as the original
  95.                                         file.   In this mode if the text
  96.                                         "/NOLOAD" is entered as a second
  97.                                         file  name  then the text buffer
  98.                                         will not be preloaded  with  the
  99.                                         contents of the file.
  100.     4) ECCE <filename> .N             - "Show" <filename>; do not create
  101.                                         an  output  file  or  record any
  102.                                         changes made.
  103.     5) ECCE                           - edit the file last  written  to.
  104.  
  105.  
  106. 3   Commands
  107.     --------
  108.  
  109.    There  are  two  types of command in ECCE, basic and special.   Basic
  110. commands are used to manipulate text in the file buffer, whereas special
  111. commands alter the editing environment.   Special commands begin with  a
  112. "%".
  113.  
  114.  
  115. 3.1 Basic Commands
  116.     --------------
  117.  
  118.    ECCE basic commands are of two main types:-
  119.     1)  Those  which  are  normally  restricted to operations within the
  120.     current line
  121.     2) Those which can move between lines,  operating  anywhere  in  the
  122.     file
  123.  
  124.   B       : BREAK  the current line into two lines at the current cursor
  125.             position
  126.   C (-)   : change the CASE of the character to the  right/left  of  the
  127.             cursor in the current line
  128.   D/text/ : DELETE  the  first  occurrence of <text> on the current line
  129.   E (-)   : ERASE the character to the right/left of the cursor  and  in
  130.             the current line
  131.   F/text/ : FIND the next occurrence of <text> in the file.
  132.   G/text/ : GET <text>.  Insert it as a complete line before the current
  133.             line
  134.   I/text/ : INSERT  <text> at the current cursor position in the current
  135.             line
  136.   J       : JOIN the current line to the next one
  137.   K (-)   : KILL the whole of the current/previous line
  138.   L       : Shift the file pointer LEFT one  character  on  the  current
  139.             line
  140.   M (-)   : MOVE to the next/previous line
  141.   O/text/ : OVERWRITE  the  text to the right of the cursor with <text>,
  142.             extending the current line if necessary
  143.   P       : PRINT the current line
  144.   R       : Shift the file pointer RIGHT one character  on  the  current
  145.             line
  146.   S/sbs/  : SUBSTITUTE <sbs> for the <text> found, verified or uncovered
  147.   T/text/ : TRAVERSE  <text>.   Place  file  pointer after <text> on the
  148.             current line.  Text traversed cannot be substituted.
  149.   U/text/ : UNCOVER <text>.   Remove all characters on the current  line
  150.             up to but not including <text>
  151.   V/text/ : VERIFY  that  the  text to the right of the file pointer and
  152.             in the current line is <text>
  153.   W       : Use macro W
  154.   X       : Use macro X
  155.   Y       : Use macro Y
  156.   Z       : Use macro Z
  157.  
  158.    The text parameter with commands G, I, O, and S is optional; if it is
  159. not given then the text is entered when the command executes.
  160.  
  161.  
  162. 3.2 Special Commands
  163.     ----------------
  164.  
  165.   %A      : ABORT - abandon editing session
  166.   %B      : BACKUP - equivalent to closing edit and  running  ECCE  with
  167.             the name of the file written to as parameter
  168.   %C      : CLOSE  EDIT - write text buffer to disk, close files, return
  169.             to CP/M
  170.   %F      : Print current line whenever the cursor  is  moved  (default)
  171.   %H      : Toggle  HELP  mode.   All  failures  are  explained  if help
  172.             mode is on.
  173.   %I      : Give useful INFORMATION
  174.   %L      : Regard the case of the text  as  significant  when  finding,
  175.             verifying, traversing, uncovering and deleting
  176.   %M      : Print  current  line  only  when  moving to it or when the P
  177.             command is used
  178.   %P      : Save the macros, monitoring mode and the setting of %L/%U in
  179.             a named profile file or, by default, in file PROFILE.ECE  on
  180.             the  default  disk.   They will be loaded automatically when
  181.             ECCE is next used if stored in the default file.
  182.   %Q      : Print current line only when P command is used
  183.   %R      : RESTORE macros from a named disk file or  the  default  file
  184.   %S      : When  first  called, define a named secondary input file and
  185.             switch to it.   When  subsequently  called,  switch  between
  186.             primary and secondary files.
  187.   %U      : Disregard case when finding, verifying, traversing, deleting
  188.             or uncovering (default)
  189.   %W      : Define / display macro W
  190.   %X      : Define / display macro X
  191.   %Y      : Define / display macro Y
  192.   %Z      : Define / display macro Z
  193.  
  194.    There are no special commands to write out part of the text buffer to
  195. the output file; ECCE handles this automatically.
  196.  
  197.  
  198. 3.3 More on Basic Commands
  199.     ----------------------
  200.  
  201.    Any basic command can be repeated by placing a number after it :-
  202.  
  203.          f/fred/3            - find  the third occurrence of fred in the
  204.                                file
  205.  but note
  206.          f/fred/i/I am /3    - will find the first  occurrence  of  fred
  207.                                and insert "I am " 3 times giving
  208.                                "I am I am I am fred"
  209.  
  210.    To  change  the  next three occurrences of 'fred' to 'I am fred', the
  211. command should be bracketed
  212.                 (f/fred/i/I am /)3
  213.  
  214.    To execute a command an indefinite number of times, the character '*'
  215. or the number '0' should be placed after the command.   This will result
  216. in the relevant command being executed up to 32767 times.
  217.  
  218.    For  example,  the normal way of entering lines of text into the file
  219. is to type
  220.                 >>G0
  221.  
  222.    To exit from the 'G' command, a single ':' should be inserted at  the
  223. start of a line, followed immediately by <return>.
  224.  
  225.    The  console buffer used by HISOFT PASCAL is 80 characters long so if
  226. more than 80 characters are entered in one line from the keyboard  while
  227. using the G command then a newline character will be inserted.   However
  228. when text is entered from disk ECCE will  accept  lines  of  up  to  121
  229. characters  before inserting a newline, and further text can be added by
  230. the I(nsert) command.   If by any means the line is  made  132  or  more
  231. characters  long  then later attempts to I(nsert) in that line will fail
  232. until the user splits it by applying B(reak) to it  or  shortens  it  in
  233. some way.
  234.  
  235.    The  search  range  for  commands  F,  U  and  T  can  be extended or
  236. restricted by placing a number after the command but before the text.
  237.  
  238.    As described above F searches for text through the whole of the file,
  239. but this can be restricted by placing a number after the F, so
  240.  
  241.           F23/fred/
  242.  
  243. will only look for 'fred' on the next 23 lines.
  244.  
  245.    D, U and T normally only search the current line,  but  this  can  be
  246. extended similarly :-
  247.  
  248.           t50/joe/
  249.  
  250. will try to traverse 'joe' but will fail if it is not within 50 lines of
  251. the current cursor position.
  252.  
  253.  
  254.    The maximum search restriction or extension is 511 lines.
  255.  
  256.    The previous command line can be executed again by typing a number on
  257. the next line.  The previous line will be executed as if it had brackets
  258. around it.
  259.  
  260.    Pressing  <return>  on  its  own  will  cause  ECCE to execute an 'M'
  261. command.  If '-' is typed at the start of the line followed by <return>,
  262. all <return>'s after that will cause ECCE to execute  an  'M-'  command,
  263. until a further '-' is entered, or another command is used.
  264.  
  265.    Error  reports  are  given when ECCE is checking the command line for
  266. syntax errors or when a correctly formed command line causes  a  failure
  267. when  it  is  running.   Syntax  errors  are  reported  by  printing the
  268. offending character or characters followed by a query
  269.   e.g.
  270.         >>r-           { Should be "l" }
  271.          -?
  272.         >>
  273.  
  274.    An error will also be reported if there are mismatched brackets or if
  275. a command line or macro definition is too long.   Macros can be up to 64
  276. characters.  Note, however, that macros are expanded and placed into the
  277. command  buffer  when  used,  so  it is possible to get an overflow if a
  278. large macro is used many times.  If possible use brackets instead.
  279.  
  280.    Failure occurs if the command typed cannot be executed  successfully.
  281. A message of the form
  282.  
  283.     Failure: <editor command>
  284.  
  285. will be displayed.
  286.  
  287.    This failure condition can be turned to advantage by the use of three
  288. more symbols recognised by ECCE
  289.  
  290.           ,      \      ?
  291.  
  292.    The comma causes 'alternative command execution'.  If one part of the
  293. command line fails, ECCE tries the next part.
  294.  
  295.   e.g.     (rli/ /2m,m)0
  296.  
  297.  
  298.    This  command  will  cause  two spaces to be inserted at the start of
  299. every line in the file , BUT only if it is NOT blank.   This is  because
  300. 'r'  will  fail if there is nothing on the line, so control will pass to
  301. the 'm' after the ',' and the  editor  will  then  try  the  next  line.
  302. However,  if  the line is not empty then two spaces will be inserted and
  303. ECCE will move to the next line.  There can be any number of commas in a
  304. command.
  305.  
  306.    Backslash '\' inverts the failure condition; so a failure occurs when
  307. an operation is successful.
  308.  
  309.           (r\li/ /2m,m)0
  310.  
  311. would cause two spaces to be inserted on every blank line and  no  other
  312. line.
  313.  
  314.    Query  '?' causes ECCE to ignore the failure condition, and execution
  315. continues uninterrupted.  e.g.  r?  or (f1/fred/2)?
  316.  
  317.    A more useful example of ',' is
  318.  
  319.           %X=(r,i/ /)
  320.  
  321.    If the command 'X23' is now issued, the file  pointer  will  move  to
  322. column  23  on  the screen, inserting any spaces if the line is not long
  323. enough.  This is useful when creating tables.
  324.  
  325.    Another example of failure is the following :-
  326.  
  327.       (r0 ( l d/ / )0 m)0
  328.  
  329.    which will remove any trailing spaces at the end of all lines in  the
  330. file.   Specifying  the  number  of repetitions as '0' or '*' causes the
  331. command to be  executed  as  many  times  as  possible  without  causing
  332. failure.   Thus  the  command E7 will fail if there are not 7 characters
  333. left on the line, but E0 will delete all the remaining characters on the
  334. line and WILL NOT FAIL.   Similarly in the above example (l d/ /)0 means
  335. "delete as many trailing spaces as possible".
  336.  
  337.  
  338.    The  symbol  ';' makes ECCE execute the current command line as if it
  339. were two (or more) lines, the lines being separated by the ';' symbol.
  340.  
  341.    In these examples the symbol  '/'  has  been  used  to  delimit  text
  342. strings, but any of the following can be used :-
  343.  
  344.     # & ' .  / : < = > @ [ ] ^ _
  345.  
  346.    So to find a '/' the following command could be used :-
  347.  
  348.     >>F./.
  349.  
  350.    Finally,  execution  of  any  command  sequence  can  be abandoned by
  351. pressing <escape>.  Note that this requires CP/M function 6 which is not
  352. present in some early versions.
  353.  
  354.  
  355. 3.4 More on Special Commands
  356.     ------------------------
  357.  
  358. %S :    With ECCE you can define a secondary input file from which input
  359.         is to be taken.   When in secondary input mode all commands  can
  360.         be used except those which move the file pointer backwards.  Any
  361.         text passed over is copied to the main file buffer.
  362.  
  363.         To define a secondary input file type
  364.  
  365.                 %S=<filename>
  366.  
  367.         To switch between primary and secondary input type
  368.  
  369.                 %S
  370.  
  371.         If you wish to include all of a file you should type
  372.  
  373.                 %S=<filename>
  374.                 M0
  375.                 %S
  376.  
  377.         To include only part of a file (starting at <text> say) type
  378.  
  379.                 %S=<filename>
  380.                 U0/text/
  381.  
  382.         and  now  step over the lines required by pressing return, using
  383.         M, or FINDing the last piece of text you wish to include, or  by
  384.         any other means that seem appropriate.  Now type
  385.  
  386.                 %S
  387.  
  388.         to get back to the original file.
  389.  
  390.  
  391.  
  392. %P :    As described above this command will save macros, the monitoring
  393.         mode  and  the  setting  of %L/%U in the file PROFILE.ECE on the
  394.         default disk.   It is possible to specify the file to which  the
  395.         information is to be written (thus enabling the user to build up
  396.         a library of macros) by typing
  397.  
  398.                 %P=<filename>
  399.  
  400. %R :    This command can also be given a filename as a parameter so that
  401.         the macros will be loaded from the specified file by typing
  402.  
  403.                 %R=<filename>
  404.  
  405.  
  406. 3.5 More on Macros
  407.     --------------
  408.  
  409.    To define a macro, type
  410.  
  411.                 %W=<macro text>
  412.  
  413.         or      %X=<macro text>
  414.  
  415.         or      %Y=<macro text>
  416.  
  417.         or      %Z=<macro text>
  418.  
  419.    A  macro text can be up to 64 characters long but, if one macro calls
  420. other macros the combined  macro  texts  must  not  exceed  the  command
  421. buffer's  dynamic  limit  of  about  150 to 200 characters, otherwise an
  422. error message will be displayed.
  423.  
  424.    To display a macro, type
  425.  
  426.                 %W
  427.  
  428.         or      %X
  429.  
  430.         or      %Y
  431.  
  432.         or      %Z
  433.  
  434.    To use a macro simply enter W or X or Y or Z in the command line.
  435.         Example
  436.                 >>%X=f/fred/
  437.                 >>%Y=s/joe/
  438.                 >>%Z=x
  439.  
  440.                 >>xyz
  441.  
  442.         will be translated to
  443.  
  444.                 >>f/fred/s/joe/f/fred/
  445.  
  446.    Here are some examples of elaborate macros which are worth saving  in
  447. suitably named files.
  448.  
  449.    First, a set for displaying a number of lines on a video screen:
  450.  
  451.         %X=((p10)?)
  452.  
  453. ie  print  the  next ten lines OR, if there are not ten left, print what
  454. there is.   The macro is in brackets so that it can be  set  to  operate
  455. more than once
  456.  
  457.         %Y=(m-10p10m-8,p10m-0,m-0)
  458.  
  459. ie  move  back ten lines,print those ten and set the file pointer to the
  460. the first line printed OR, if there are not ten preceding  lines,  print
  461. ten  succeeding  lines and move back to the beginning of the file, OR if
  462. there are not ten such lines to print, go to the beginning of the file
  463.  
  464.         %Z=(m-5p10m-4)
  465.  
  466. ie move back five lines, print ten then go back four lines to the  fifth
  467. line of text displayed on the screen
  468.  
  469.    Now a text processing set used to produce lines which come as near as
  470. possible to a standard size
  471.  
  472.         %W=(l0ry(lv/ /\)0ebxp,r0z)
  473.  
  474. ie find the start of the line, move right the number of characters shown
  475. in  Y then move left one character at a time until a space between words
  476. is found, erase it, BREAK the line in two, insert the margin shown in  X
  477. and  print  the line OR, if this is impossible (usually because the line
  478. is less than Y characters long) move right to the end of the line,  join
  479. on  the  succeeding  line  as  shown in Z and perhaps erase some leading
  480. spaces ready for W to be repeated.  Note that the W macro can be adapted
  481. for different required line lengths and leading spaces by altering  only
  482. the short macros X, Y and Z.  Typically these might read:
  483.  
  484.         %X=i/ /2    ie insert two leading spaces
  485.  
  486.         %Y=75       ie  the  maximum  number  of  characters  wanted  in
  487.                     the line
  488.  
  489.         %Z=je       ie join on the  next  line  and  erase  one  of  the
  490.                     two leading spaces
  491.  
  492. Alternatively:
  493.  
  494.         %X=         ie do not insert leading spaces
  495.         %Y=75       as before
  496.         %Z=i/ /j    ie  insert  a space before joining on the next line.
  497.                     Note that the space is inserted before the  line  is
  498.                     joined because the insertion could fail if the lines
  499.                     were joined first due to the increased line length.
  500.  
  501.    NEVER define recursive macros of the form
  502.  
  503.     >>%x=y
  504.     >>%y=x
  505.  
  506. and  then  use  X  in  a  command because ECCE will loop indefinitely in
  507. trying to substitute a command for X.
  508.  
  509.  
  510. 4   Sample ECCE session
  511.     -------------------
  512.  
  513.   A>ECCE .N TEST.TXT
  514.   ECCE  Z80 Version 12:Feb:84
  515.   Creating TEST.TXT
  516.   >>g0                                              {Get text}
  517.   The quick brown
  518.   fox jumps over
  519.   the lazy dog.
  520.   :                                                 {End of text}
  521.   **END**
  522.   >>m-0                                             {Move to start of file}
  523.   The quick brown
  524.   >>f/ qui/                                          {Move to start of 'quick'}
  525.   The^ quick brown
  526.   >>i                                               {Insert ' very' before quick}
  527.   I> very                                           {Text entered at run time}
  528.   The very ^quick brown
  529.   >>t/k/i/ greyish-/e
  530.                                               {Move to end of 'quick'}
  531.                                               {Insert ' greyish-'}
  532.                                               {and erase space}
  533.   The very quick greyish-^brown
  534.   >>%X                                              {Display current macros}
  535.   (P10)
  536.   >>%Y
  537.   (M-10P10M-9)
  538.   >>%Z
  539.   (M-5P10M-9)
  540.   >>%X=(rli/ /2m,m)                                 {Re-define X}
  541.                                               {See 3.3 for}
  542.                                               {meaning of macro}
  543.   >>l0x0                                          {Use X}
  544.   **END**
  545.   >>m-0p0                                           {Print whole file}
  546.     The very quick greyish-brown
  547.     fox jumps over
  548.     the lazy dog.
  549.   **END**
  550.   >>m-0f2/zy/                                       {Example to show}
  551.                                               {restriction of search}
  552.                                               {range and failure}
  553.   Failure: F'zy'
  554.     fox jumps over
  555.   >>m-0                                             {Back to start}
  556.     The very quick greyish-brown
  557.   >>t3/zy/                                          {Extension of}
  558.                                               {search range}
  559.       the lazy^ dog.
  560.   >>m-0f/g/
  561.     The very quick ^greyish-brown
  562.   >>u/br/                                           {Uncovering text}
  563.     The very quick ^brown
  564.   >>c0                                              {Changing case}
  565.     The very quick BROWN^
  566.   >>j                                               {Joining lines}
  567.     The very quick BROWN^  fox jumps over
  568.   >>e
  569.     The very quick BROWN^ fox jumps over
  570.   >>je
  571.     The very quick BROWN fox jumps over^ the lazy dog.
  572.   >>m
  573.   **END**
  574.   >>k                                               {Another example of failure}
  575.   Failure: K
  576.   **END**
  577.   >>m-0
  578.     The very quick BROWN fox jumps over the lazy dog.
  579.   >>t/own/bi/ /t/er/bi/ /m-0p0                      {Break into 3 lines again}
  580.     The very quick BROWN
  581.     fox jumps over
  582.     the lazy dog.
  583.   **END**
  584.   >>%c                                              {Close edit}
  585.   File TEST.TXT written to
  586.  
  587.   A>
  588.  
  589.  
  590. 5   Gruesome Details
  591.     ----------------
  592.  
  593.    This section describes the design philosophy of the editor.
  594.  
  595.    The text in ECCE's text buffer is stored in two parts, one  from  the
  596. start  of  the  buffer  to  the address in the current file pointer, the
  597. other from the address shown by a further pointer  to  the  end  of  the
  598. buffer.   It  is into the gap in between these two pointers that text is
  599. inserted,  substituted  etc.    When  the   gap   becomes   too   small,
  600. approximately  half  of  the  buffer  is  written  to  the  output file.
  601. Deleting is only a matter of moving one or other of the pointers.
  602.  
  603.    The buffer can be seen like this :-
  604.  
  605.    NL O N E NL T W . . . O NL N E X T NL - - - NL L A S T NL NL
  606.       ^        ^   ^     ^  ^                                 ^
  607.       T        L   P     F  L                                 F
  608.       O        B   P     P  E                                 E
  609.       P        E            N                                 N
  610.                G            D                                 D
  611.  
  612.   where  TOP        is the start of the buffer
  613.          LBEG       is the start of the line
  614.          PP         is the start of the gap
  615.          FP         marks the start of the rest of the line
  616.          LEND       is the end of the line
  617.          FEND       is the end of the file
  618.          NL         is a character to separate lines
  619.                     (currently carriage return)
  620.  
  621.  
  622.    If we call the array holding the file BUFF then it can be seen that
  623.  
  624.   R can be performed by
  625.                        fail IF FP = LEND
  626.         otherwise      BUFF[pp] := BUFF[fp]
  627.                        FP := FP + 1;
  628.                        PP := PP + 1;
  629.  
  630.   E4 would be performed by
  631.                         fail IF LEND = FP
  632.          otherwise      FP := FP + 1;  repeated 4 times
  633.  
  634.  
  635.    Commands are stored in a command array as fixed length  units.   This
  636. unit is made up of three 16 bit numbers called
  637.  
  638.    CODE   - the   lowest   7   bits  contain  the  ASCII  code  for  the
  639.             command, the  upper  9  contain  the  range  restriction  or
  640.             extension number when used with F,U,T,D
  641.  
  642.    TEXT   - A  pointer  to  the  text  to  be  found; the text is stored
  643.             backwards at the end of the command array.
  644.  
  645.    NUM    - Repetition number.
  646.  
  647.   So the command    t0/Glug/7  would be stored as
  648.  
  649.      1    2   3   4          296 297 298 299  300
  650.    -----------------------------------------------
  651.    ! T ! 300 ! 7 ! . . . . .! 0 ! g ! u ! l !  G !
  652.    -----------------------------------------------
  653.      ^    ^    ^              ^                ^
  654.      !    !    !              !                !
  655.   CODE  TEXT  NUM      end of text        start of text
  656.           !                                    !
  657.           --------------------->----------------
  658.  
  659.  
  660.    The meanings of these components differ when a bracket or a comma  is
  661. being represented :-
  662.  
  663.  For a close bracket;
  664.  
  665.     TEXT is a pointer to the corresponding open bracket
  666.     NUM  is   the   number   of   times  the  bracketed  command  string
  667.          is to be executed
  668.  
  669.  For an open bracket;
  670.  
  671.     NUM  is the level at which the current bracket is nested
  672.     TEXT points to the corresponding close bracket
  673.  
  674.    A comma unit is similar to an open bracket unit.
  675.  
  676.    It can be seen that once this command array has been built up  it  is
  677. very  easy to execute it.   One simply needs a pointer (initially at the
  678. start of the array)  which  is  incremented  by  3  after  every  normal
  679. command,  and  set  to  the position of the opening bracket when a close
  680. bracket is encountered, and which is incremented by 3 repeatedly when  a
  681. failure  occurs  until  a  comma  or  the  end  of  the command array is
  682. encountered.   At each stage current values of  CODE,TEXT  and  NUM  are
  683. available to describe the current command.
  684.  
  685.  
  686.  
  687.  
  688.  
  689.  
  690.  
  691.  
  692.  
  693.  
  694.  
  695.  
  696.  
  697.  
  698.  
  699.  
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.