Random Joke Function

You can create your own joke, saying, training, or inspirational phrase
file and have SAM index it, and speak a random selection from the file
any time the space bar is pressed when the main window is active.

A sample file is included with this upgrade: The file oneliner.txt.

Here's how you create the files:

 1. Make a file of paragraphs or phrases with a line between each joke
that starts with "[]".  This is the special sequence that SAM uses to
index the jokes. The file would look something like this:

------------
This is the first joke. ( on the first line of the file, too)
[]
This is the next joke. 
[]
This is another one.
[]
Etc.
----------------------

2. Start SAM and select 'R' to read a file.  Enter the path and file
name of the file you just created.  Enter a read mode of 'I' (for Index).
Press Enter, and SAM will signal you when the indexing is finished.  This
will happen quickly, unless you have a very large file.

3. SAM has now created two files:  saying.dat which is just a copy of
your file, and saying.ndx which is an index of the saying.dat file.

4. Now any time you press the space bar when SAM's main window is displayed,
 SAM will generate a random number and find that joke/phrase in the file 
and speak it. If you are in another application, press the Pause key first,
then the space bar. SAM will return to it's previous state and will return
you to your application.

5. You can create any number of phrase files, and everytime you index one
of them, it will overwrite the saying.dat and saying.ndx files. The 'saying'
files always contain the current jokes/phrases for SAM to speak.

Have fun! If you create any interesting phrase file, and don't mind sharing
it, send it to me and I might publish it on my web site for others to
download and try.

Tom Slemko




