home *** CD-ROM | disk | FTP | other *** search
/ Turbo Toolbox / Turbo_Toolbox.iso / sharew / exoten / rec / examples.doc < prev    next >
Encoding:
Text File  |  1990-10-29  |  7.0 KB  |  167 lines

  1.  
  2. This file describes the Convert sample programs contained in this disk.
  3.  
  4. MAZE.CNV    This program computes and lists all paths through a maze
  5.         read from the standard input.  The maze is specified as a
  6.         list
  7.  
  8.             (ni nf (na (na1 ... nak) ... nz (nz1 ... nzj)))
  9.  
  10.         where ni is the starting node, nf is the ending node and
  11.         the remaining list gives the graph edges (e.g., there are
  12.         edges from na to na1, ..., nak).  The program ends when 
  13.         ctrl-Z (end of file) is read from the standard input.
  14.  
  15. CALC.CNV    This program accepts lines in the form <expr> or <var>=<expr>,
  16.         where <expr> is an arithmetic expression whose operands are 
  17.         variables or constants and <var> is a veriable, i.e., a 
  18.         letter followed by zero or more letters or digits.  In the 
  19.         first form, the expression is evaluated and the result is 
  20.         displayed.  In the second form the expression is evaluated 
  21.         and assigned to the variable on the left of the equals sign. 
  22.         The program ends when given a line starting with ctrl-Z (end 
  23.         of file on the standard input).  In the following sample 
  24.         dialog, the ">" character is a prompt, followed by the user's 
  25.         response; lines not starting with ">" are the program's 
  26.         output and the annotations in square brackets are added 
  27.         commentary.
  28.  
  29.         C>rec86f calc        [execute CALC with REC86F]
  30.  
  31.         Accepts <arit.expr.> or <var.>=<arith.expr.>
  32.         > pi=3.14159265        [assign var. "pi" a value]
  33.         > pi^2            [evaluate "pi" squared]
  34.         9.86960438        [result of evaluating pi^2]
  35.         > entero1=4        [create a new variable]
  36.         > entero2=3*(8-3)    [another one, with value 15]    
  37.         > entero1/entero2
  38.         0            [integer division truncates quotient]
  39.         > entero2/entero1
  40.         3            [15/4, truncated]
  41.         > entero1*
  42.         * not recognized    [entero1* is not a well-formed expr.]
  43.         > entero1*pi
  44.         12.55663706        [4*3.14159265]
  45.         > ^Z            [control-Z]
  46.         C>            [back to MS-DOS]
  47.  
  48.         Acceptable numeric constants are described in Chapter 3 of 
  49.         the REC help files.  Operators recognized by CALC are those 
  50.         accepted by the built-in Convert function #f described in
  51.         CNVADV.HLP.
  52.  
  53. BORRA.CNV    Erases files interactively; it is executed as follows:
  54.  
  55.                 rec86 borra pathname
  56.  
  57.         where pathname is a standard MS-DOS pathname consisting of an 
  58.         optional disk identifier followed by a colon, optional 
  59.         subdirectory names separated by backslashes and a file name 
  60.         possibly containing the wildcard characters "*" and "?".
  61.         For each file matching pathname, BORRA will ask whether the 
  62.         file should be erased.  Possible answers are yes, no, quit
  63.         and show.  "Yes" causes the indicated file to be deleted; 
  64.         BORRA will then go on to the next name, if there is one.
  65.         "No" causes the file to be kept, and the program goes on to 
  66.         the next name, if any.  "Quit" terminates BORRA's execution 
  67.         immediately.  "Show" displays the first 70 bytes of the file 
  68.         on the screen; ASCII characters outside the standard graphic
  69.         subset (space to ~) are shown as periods; BORRA will then ask
  70.         again whether it should erase that file.  Answers to prompts 
  71.         may be given as single letters (y, n, q, s).
  72.  
  73. DUMP.CNV    Performs a hexadecimal dump of the file given on the command 
  74.         line.  Each line contains also the ASCII equivalent of each 
  75.         byte; but bytes with values between 0 and 31 or 127 and 255
  76.         appear as periods.
  77.  
  78. OFF.CNV        Copies a file int another one of the same name and extension 
  79.         .OFF in which the most significant bit of each byte is turned 
  80.         off.  This may be used, for instance, to convert a WordStar 
  81.         "document" file into a plain ASCII file.  For example,
  82.  
  83.             rec86 dump xyz.txt
  84.  
  85.         makes a copy of XYZ.TXT, called XYZ.OFF, in which no byte has 
  86.         its most significant bit on.
  87.  
  88. ATIDOU.CNV    Prints all files from a list of pathnames (which may be 
  89.         repeated and may contain wildcard characters) on both sides 
  90.         of the paper:  the program prints all odd-numbered pages of 
  91.         all files, then waits for the paper to be turned over so that 
  92.         the next page to be printed is the back of the first page 
  93.         printed in the first step, and finally it prints all even- 
  94.         numbered pages of all files.  It writes tab characters to the 
  95.         printer without expanding them into spaces.  Any line 
  96.         exceeding 80 characters is truncated to the first 80; these 
  97.         lines are flagged with a "[" on the right margin. The 
  98.         skeleton (%p,(^[)@(^[)6) appearing twice in the program is 
  99.         the printer reset escape sequence for an ATI Z-3000 printer 
  100.         (a Mexican variant of a Seikosha printer). (^[) generates 
  101.         ESC; ESC @ resets the printer, ESC 6 selects the second 
  102.         character table on this printer.  The program is executed 
  103.         with the command line
  104.  
  105.             rec86 atidou list
  106.  
  107.         where "list" is one or more (possibly ambiguous) pathnames,
  108.         separated by commas.
  109.  
  110. ATISNG.CNV    Similar to ATIDOU, but it prints all pages in a single pass, 
  111.         in order.
  112.  
  113. PRDO.CNV    Similar to ATIDOU in function and operation, but it replaces 
  114.         tab characters by enough spaces to fill out the standard 8-
  115.         column tabbing before printing.  It contains no printer-
  116.         specific codes, so it may be used with any printer.  Tab 
  117.         expansion, however, renders this program slower.
  118.  
  119. HILBERT.CNV    A program to draw Hilbert's curve to order up to 7 (which
  120.         takes a long time to draw a solid block).  The command line 
  121.         is 
  122.         
  123.             rec86 hilbert order
  124.  
  125.         where order is a number from 1 to 7.  If "order" is not 
  126.         given or is wrong, the program will prompt for it.
  127.  
  128. C.CNV        A program to draw a recursive C.  The order is fixed.
  129.  
  130. GATO.CNV    A program to play standard tic-tac-toe.
  131.  
  132. RESET.CNV    A program to reset the screen to mode 3 (CGA color text
  133.         mode, 80x25).
  134.  
  135. CCONVERT.CNV    Convert in Convert.  It takes a single Convert source file as 
  136.         argument and produces a file of the same name (including 
  137.         disk and path, if any), but with extension REC.  A lot slower 
  138.         than CONVERT.REC, the Convert compiler hand coded in REC, but 
  139.         a lot easier to modify when porting to other machines or 
  140.         target codes.  This was the basis for machine-code compilers 
  141.         of Convert for the 8086 and the 68000.
  142.         
  143. RCONVERT.CNV    Same as the preceding, but a few patterns and skeletons are
  144.         cast in REC for the sake of speed, using the (REC/.../) pattern
  145.         and skeleton described in CNVADV.HLP.
  146.  
  147. PINWHL2.CNV    A dragon curve generator.  Draws a recursive pinwheel; uses
  148.         the (REC/.../) skeleton to speed up some pixel address
  149.         calculations.
  150.         
  151. SILA.CNV    A program to hyphenate Spanish words.  It reads the standard 
  152.         input, writes on the standard output.
  153.         
  154. EDIT.CNV    A command line interpreter for a REC screen editor SCR.REC.
  155.         A separate text file contains instructions for this.
  156.  
  157. SQREC.CNV    A program to squeeze REC source files (gets rid of irrelevant
  158.         blanks, comments, CRs and LFs). It takes one argument assumed 
  159.         to be the name of a REC program; the product is left in a 
  160.         file of the same name and extension RQC.
  161.  
  162. COMEJ.CNV    A program which invokes CONVERT.REC once to compile all of 
  163.         the above programs
  164.  
  165. [EXAMPLES.DOC]
  166. [G. Cisneros, 30.10.90]
  167.