home *** CD-ROM | disk | FTP | other *** search
-
- This file describes the Convert sample programs contained in this disk.
-
- MAZE.CNV This program computes and lists all paths through a maze
- read from the standard input. The maze is specified as a
- list
-
- (ni nf (na (na1 ... nak) ... nz (nz1 ... nzj)))
-
- where ni is the starting node, nf is the ending node and
- the remaining list gives the graph edges (e.g., there are
- edges from na to na1, ..., nak). The program ends when
- ctrl-Z (end of file) is read from the standard input.
-
- CALC.CNV This program accepts lines in the form <expr> or <var>=<expr>,
- where <expr> is an arithmetic expression whose operands are
- variables or constants and <var> is a veriable, i.e., a
- letter followed by zero or more letters or digits. In the
- first form, the expression is evaluated and the result is
- displayed. In the second form the expression is evaluated
- and assigned to the variable on the left of the equals sign.
- The program ends when given a line starting with ctrl-Z (end
- of file on the standard input). In the following sample
- dialog, the ">" character is a prompt, followed by the user's
- response; lines not starting with ">" are the program's
- output and the annotations in square brackets are added
- commentary.
-
- C>rec86f calc [execute CALC with REC86F]
-
- Accepts <arit.expr.> or <var.>=<arith.expr.>
- > pi=3.14159265 [assign var. "pi" a value]
- > pi^2 [evaluate "pi" squared]
- 9.86960438 [result of evaluating pi^2]
- > entero1=4 [create a new variable]
- > entero2=3*(8-3) [another one, with value 15]
- > entero1/entero2
- 0 [integer division truncates quotient]
- > entero2/entero1
- 3 [15/4, truncated]
- > entero1*
- * not recognized [entero1* is not a well-formed expr.]
- > entero1*pi
- 12.55663706 [4*3.14159265]
- > ^Z [control-Z]
- C> [back to MS-DOS]
-
- Acceptable numeric constants are described in Chapter 3 of
- the REC help files. Operators recognized by CALC are those
- accepted by the built-in Convert function #f described in
- CNVADV.HLP.
-
- BORRA.CNV Erases files interactively; it is executed as follows:
-
- rec86 borra pathname
-
- where pathname is a standard MS-DOS pathname consisting of an
- optional disk identifier followed by a colon, optional
- subdirectory names separated by backslashes and a file name
- possibly containing the wildcard characters "*" and "?".
- For each file matching pathname, BORRA will ask whether the
- file should be erased. Possible answers are yes, no, quit
- and show. "Yes" causes the indicated file to be deleted;
- BORRA will then go on to the next name, if there is one.
- "No" causes the file to be kept, and the program goes on to
- the next name, if any. "Quit" terminates BORRA's execution
- immediately. "Show" displays the first 70 bytes of the file
- on the screen; ASCII characters outside the standard graphic
- subset (space to ~) are shown as periods; BORRA will then ask
- again whether it should erase that file. Answers to prompts
- may be given as single letters (y, n, q, s).
-
- DUMP.CNV Performs a hexadecimal dump of the file given on the command
- line. Each line contains also the ASCII equivalent of each
- byte; but bytes with values between 0 and 31 or 127 and 255
- appear as periods.
-
- OFF.CNV Copies a file int another one of the same name and extension
- .OFF in which the most significant bit of each byte is turned
- off. This may be used, for instance, to convert a WordStar
- "document" file into a plain ASCII file. For example,
-
- rec86 dump xyz.txt
-
- makes a copy of XYZ.TXT, called XYZ.OFF, in which no byte has
- its most significant bit on.
-
- ATIDOU.CNV Prints all files from a list of pathnames (which may be
- repeated and may contain wildcard characters) on both sides
- of the paper: the program prints all odd-numbered pages of
- all files, then waits for the paper to be turned over so that
- the next page to be printed is the back of the first page
- printed in the first step, and finally it prints all even-
- numbered pages of all files. It writes tab characters to the
- printer without expanding them into spaces. Any line
- exceeding 80 characters is truncated to the first 80; these
- lines are flagged with a "[" on the right margin. The
- skeleton (%p,(^[)@(^[)6) appearing twice in the program is
- the printer reset escape sequence for an ATI Z-3000 printer
- (a Mexican variant of a Seikosha printer). (^[) generates
- ESC; ESC @ resets the printer, ESC 6 selects the second
- character table on this printer. The program is executed
- with the command line
-
- rec86 atidou list
-
- where "list" is one or more (possibly ambiguous) pathnames,
- separated by commas.
-
- ATISNG.CNV Similar to ATIDOU, but it prints all pages in a single pass,
- in order.
-
- PRDO.CNV Similar to ATIDOU in function and operation, but it replaces
- tab characters by enough spaces to fill out the standard 8-
- column tabbing before printing. It contains no printer-
- specific codes, so it may be used with any printer. Tab
- expansion, however, renders this program slower.
-
- HILBERT.CNV A program to draw Hilbert's curve to order up to 7 (which
- takes a long time to draw a solid block). The command line
- is
-
- rec86 hilbert order
-
- where order is a number from 1 to 7. If "order" is not
- given or is wrong, the program will prompt for it.
-
- C.CNV A program to draw a recursive C. The order is fixed.
-
- GATO.CNV A program to play standard tic-tac-toe.
-
- RESET.CNV A program to reset the screen to mode 3 (CGA color text
- mode, 80x25).
-
- CCONVERT.CNV Convert in Convert. It takes a single Convert source file as
- argument and produces a file of the same name (including
- disk and path, if any), but with extension REC. A lot slower
- than CONVERT.REC, the Convert compiler hand coded in REC, but
- a lot easier to modify when porting to other machines or
- target codes. This was the basis for machine-code compilers
- of Convert for the 8086 and the 68000.
-
- RCONVERT.CNV Same as the preceding, but a few patterns and skeletons are
- cast in REC for the sake of speed, using the (REC/.../) pattern
- and skeleton described in CNVADV.HLP.
-
- PINWHL2.CNV A dragon curve generator. Draws a recursive pinwheel; uses
- the (REC/.../) skeleton to speed up some pixel address
- calculations.
-
- SILA.CNV A program to hyphenate Spanish words. It reads the standard
- input, writes on the standard output.
-
- EDIT.CNV A command line interpreter for a REC screen editor SCR.REC.
- A separate text file contains instructions for this.
-
- SQREC.CNV A program to squeeze REC source files (gets rid of irrelevant
- blanks, comments, CRs and LFs). It takes one argument assumed
- to be the name of a REC program; the product is left in a
- file of the same name and extension RQC.
-
- COMEJ.CNV A program which invokes CONVERT.REC once to compile all of
- the above programs
-
- [EXAMPLES.DOC]
- [G. Cisneros, 30.10.90]