home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 391.lha / Fortune_v2.04c / fortune.doc < prev    next >
Text File  |  1990-07-03  |  6KB  |  156 lines

  1.    Program:  fortune
  2. Programmer:  George Kerber
  3.    Written:  06/16/89          Modified:  01/07/90
  4.    Version:  2.04c
  5.   Compiler:  Lattice 5.04
  6.    Purpose:  Output a "fortune" randomly from a "fortunes" file.
  7.  
  8.  
  9.     Syntax:  fortune [-l -s -#  [alternate path to the "fortunes" file]]
  10.  
  11.              The fortune program will search ram: first, then s: for a file
  12.              called "fortunes".  If found, fortune will randomly select a
  13.              fortune and display it centered on the screen.
  14.  
  15.              -s  speak the fortune instead of screen output,
  16.                     if used, all other options are meaningless.
  17.              -l  the displayed fortune will not have an outline.
  18.              -1  the outline will be white.
  19.              -2  the outline will be black (default).
  20.              -3  the outline will be orange.
  21.          
  22.              If you don't want to store the fortunes file in one of the
  23.              default locations, you can use the command line option to
  24.              specify a different location and/or file name.
  25.  
  26.              Example:
  27.  
  28.              fortune dh0:text/rules  --  will attempt to locate the
  29.                                          "dh0:text/rules" file to select
  30.                                          a fortune from.
  31.  
  32.              fortune ?               --  will display a help screen.
  33.  
  34.              fortune -3              --  will display an orange line before
  35.                                          & after the fortune.
  36.  
  37.              fortune -s              --  the fortune will be spoken using
  38.                                          the speak: device.
  39.  
  40.              The "fortunes" program will attempt to randomly select a 
  41.              "fortune" from the "fortunes" file if it exists.  Or the user
  42.              can enter a fully qualified path/file name as an alternative to 
  43.              storing the "fortunes" file in one of the default directories 
  44.  
  45.              (ram: s:)  Included with this program is a "fortunes" file.
  46.  
  47.              INSTALLATION:
  48.  
  49.              Copy the "fortune" file to your "c" directory.
  50.              Copy the "fortunes" file to your "s" directory.
  51.  
  52.              or execute the install script like this:
  53.  
  54.              1> execute fortune.install <enter>
  55.  
  56.              You may want to add "fortune" to your startup sequence.
  57.  
  58.  
  59. RULES FOR "FORTUNE" FILE CONSTRUCTION
  60.  
  61.  1.  The first line of the file is a comment line & will never be displayed.
  62.  2.  Fortunes can be up to 10 lines in length.
  63.      The first line of each fortune must not have any leading blank spaces.
  64.      Any additional fortunes lines must begin with at least on blank space.
  65.      This is how the program "knows" that there are more lines that need
  66.      to be displayed.
  67.  3.  Fortunes file should be saved as an ASCII file.
  68.      ("ed" or "memacs" is good for this.)
  69.  4.  Each line can be up to 256 characters, but for legibility, they should
  70.      be limited to 74 characters.
  71.  5.  Escape options can be added to the fortunes to display color.
  72.  
  73.      The default escape value is a '*' following standard AmigaDOS format.
  74.      The default value can be changed using the AmigaDOS setenv command.
  75.      Changing the 'escape' character is optional.  
  76.     
  77.      1> setenv ESACPE=\    ; makes the escape value a backslash
  78.                            ; or whatever you want it to be.
  79.                            ; a backslash is recommended
  80.                            ; You should have this command in your startup
  81.                            ; sequence.
  82.  
  83.      The fortune help screen will always display the current escape value.
  84.  
  85.      These are the valid format characters:
  86.  
  87.      0  Character color will be color 0 (blue)
  88.      1  Character color will be color 1 (white)
  89.      2  Character color will be color 2 (black)
  90.      3  Character color will be color 3 (orange)
  91.      4  All attributes will be reset to preferences
  92.      5  Bold
  93.      6  Underline
  94.      7  Italics
  95.      )  Background color will be color 0   (shift 0)
  96.      !  Background color will be color 1   (shift 1)
  97.      @  Background color will be color 2   (shift 2)
  98.      #  Background color will be color 3   (shift 3)
  99.  
  100. EXAMPLES
  101.  
  102. # The first line of the fortunes file is always a "comment" line.
  103. This is line 1 of the fortunes file.
  104. This is *3line*4 2 of the fortunes file.
  105.  This is line 2a of the fortunes file,
  106.  This is line 2b of the *@*3fortunes*4 file,
  107.  This is line 2c of the fortunes file.
  108. This is line 3 of the fortunes file,
  109.  This is the *3*5*6*7second line*4 of line 3.
  110. This is line 4 of the fortunes file.
  111.  
  112.  
  113. Be sure to avoid leaving any blank lines anywhere in the file, including
  114. the last line, the fortune program may randomly select it & display a
  115. blank line.  
  116.  
  117. If an unused option is escaped, fortune will simply ingnore it.  For example
  118. if a '*y' is found by the fortune program in the fortunes file, no error will
  119. be displayed, but neither will the '*' or the 'y'.
  120.  
  121. SUGGESTIONS
  122.  
  123. Since 'fortune' allows a different text file to be specified on the command
  124. line, you can have different text files for different purposes.  What if
  125. you had a file in your s: directory names 'jokes' which contained jokes
  126. written in the format described above?  And you had a script file called
  127. 'joke' which contained the line below:
  128.  
  129.    fortune s:jokes
  130.  
  131. Then whenever you executed 'joke' you would get a joke from your 'jokes'
  132. file on the screen just like the fortunes file.  Be sure to set the script
  133. bit of the script file for easier executions.  You could have 'joke' and
  134. 'dirty-joke' and 'insult' and 'bible-quote' or whatever you wanted.
  135.  
  136.    fortune -s
  137.  
  138. This will redirect the output of fortune to the speak: device.  You must
  139. have the speak: device already mounted.  All format characters inbedded in
  140. the fortunes data file will be automatically removed.
  141.  
  142.  
  143. STATUS
  144.  
  145. Fortune is public domain and can be freely distributed.  Please insure that
  146. I am kept as the author and that all documentation is intact.  If someone
  147. doesn't like one of the fortunes, too bad, the user can delete it.....
  148.  
  149.  
  150. v1.xx  06/29/89:  Initial release.
  151. v2.0   08/03/89:  Rewrote the fortune selection process.  Program now runs
  152.                   from 120 to 290% faster.
  153. v2.03  10/07/89:  Added escape color options for the text file.
  154. v2.04  12/06/89:  Added the speech option.  Recompiled with Lattice 5.04
  155. v2.04c 01/07/90:  Removed all global variables...  PURE?
  156.