quots
(last updated for version 1.15)
Contents
An ASCII version of this document is included with the self-extracting archive
you can download using the above button? For some reason, the option
"/an" mentioned in the manual is not supported by the
actual software.
1.) Purpose
Displays a "Motto Of The Day", i.e. a quotation read from a so-called
quotation file. The program automatically picks a new one at random
for every day. On one day, however, the same quotation is displayed all
the time (unless you make changes to the files, or something).
The program is intended to be installed in your "autoexec.bat" file.
Special abilities: This program ist fast. No matter how big your
quotation file may be, it will hardly take a second to select a
quotation and display it! It's easy to use, no index files, no data
or configuration files! Quotation files may be edited with any ASCII
editor! Multiple file support! And more ...
2.) Disclaimer
Any resemblance between the expressed views and those of my employer,
my terminal, or the view out my window are purely coincidental.
Any resemblance between the above and my own views is non-deterministic.
The question of the existence of views in the absence of anyone to hold
them is left as an exercise for the reader. The question of the existence
of the reader is left as an exercise for the second god coefficient.
(A discussion of non-orthogonal, non-integral polytheism is beyond the
scope of this documentation.)
Mind that I take no responsibility whatsoever for any trouble you may
be having with or because of the use of this program, in the judicial
sense, that is. Of course any ideas on improving the program are very
welcome.
The program is freeware. That means you are allowed to make as many copies
as you want, but you must never change or charge anything, and always make
a complete copy including this file. There's no warranty at all.
3.) Quotation Files
Quotation files contain all the quotations that can potentially be
displayed. In order to make it possible for QUOTS to deal with the
files correctly, you must make sure they are compatible with the
following format:
- Each file must start with a series of five percent characters.
(Looks like this: %%%%%) :-)
- Each quotation must be terminated by two percent characters.
(Yup, almost the same thing as above, but shorter: %%)
- Quotation length must range from 16 bytes to 1 kilobyte.
If you don't pay attention to this, you might never see the
ones that are too short, and only see part of those that are
too large.
Just in case you want to include very short quotations (< 16 bytes)
at any rate, you may fill up the free space with blanks. Upon
output, noone will notice, and the quotation is long enough.
Example: " Whoa. %%"
When counting quotation lengths, don't ignore line feeds, spaces, and
percent characters. (Nobody ever does that anyway. Counting, I mean.)
- The left margin of the displayed quotation is applied as given
in the quotation file. Same thing with line feeds.
- At the end of each quotation, a line feed is automatically added,
so be sure to place the terminators (tee-hee) directly after
the quotation, unless you want it to be followed by a blank line.
- Attention UNIX users! Line feed character is always CRLF.
- You are allowed to include your remarks with the file. Every line
starting with a percent character (meaning '%' is the first
character, really the first) is considered a comment and thus
ignored. Comments virtually increase the length of the surrounding
quotation. Single percent characters may be used in the quotation,
as long as they don't stand at the beginning of a line.
- There shouldn't be too many blank lines at the end of quotation
files. Might cause empty quotations to be displayed.
- A quotation file must not be larger than 1 megabyte.
- Larger quotations have a slightly better chance to be displayed.
In large files (> 20 KB), this usally doesn't matter at all, but
if you're using real tiny quotation files (< 5 KB), you might want
to increase chances for the 'small guys' by putting them in repeatedly
or otherwise increasing their size. Depends on how much you care
about things like that.
Usually, all these requirements are easy to meet. I downloaded a few
huge qfiles from Internet, and was able to use them almost immediately,
after running a search-and-replace on the quotation terminators.
Multiple files: Some people are real crazy about collecting quotations,
so they might have more than 1 MB of quotations (That's more than will
fit in a single file, remember?). So I included multiple file support.
Just specify more than one file on the command line, and QUOTS will
use them all. There are a few things you might want to know about how
QUOTS picks quotations from multiple files:
- Of all given files, only the chosen one will be checked. Other files
may not be valid quotation files. This way displaying the quotation
is not slowed down by hardly necessary file checks. Ergo that task is
up to you, unless you just want to wait for QUOTS to complain one day.
The only thing actually checked is whether the file exists at all.
- If none of the given files bears today's date, QUOTS will randomly
pick a new quotation. In situations like this, QUOTS rolls the dice
to determine which file will be used. Larger files get a better
chance according to their size.
- If only one file bears today's date, QUOTS will display the quotation
that was last displayed using this file.
- If more than one file bears the current date, it will use the first
file that has a valid quotation number. If there is no such file,
the one with the highest number will be used.
This is done in order to ensure that only one different quotation is
displayed on the same day. Of course, when you change the contents of
a file, its date and time is changed, and QUOTS may pick a different
quotation for the rest of the day.
- The Probability Problem (abbrev.: Thprpbl!)
As mentioned above, larger files have a better chance of having one
of their quotations displayed. Hence files that are a lot larger have
a significantly better chance. However, you might not want to see
quotations from nearly the same file all the time, since they are
usually of the same type, too.
Well, the solution is to tell QUOTS what file size to use for a
specific file. Simply put the imaginary file size right behind the
corresponding file name.
- 1. Example: "QUOTS a_file 2000 b_file 2000 c_file 2000"
- will eventually pick a quotation from any of the given files
that now have (and that's the new part) exactly the same chance
of being selected, no matter how big they really are.
- 2. Example: Imagine there's a quotation you like so much that you
- want to see it 50% of the time. You would just have to put it in
a file of its own and call QUOTS like this:
"QUOTS a_file 1000 b_file 1000 COOLfile 2000"
Now the chance for the quotation in COOLfile is just as big as
the total chance of all the other files together.
Of course you don't need to put numbers after all of the given files,
it's just as fine if they're just used once or twice, or not at all.
Problem: You cannot put a filename that's merely a number after
another filename. Okay, okay, then put it somewhere else ...
If QUOTS encounters an invalid file specification, it will tell you
about it, but continue with the other ones if possible. The number
of files is limited to ten.
Called with no parameters, QUOTS will attempt to open 'quots.qts' as
quotation file and display a quotation. If this fails, it will display
a brief online help screen.
4.) Options
Well, there are a few options. Not very many though.
If you don't want to specify any options, you don't have to.
The order in which options are given does not matter. Options may even
be mixed with file specifications. They are recognized by their preceding
slashes or hyphens.
- Title String ( /T:"<title string>" )
Changes the title string (surprise!). Mind the colon.
<title string> may include spaces. Whereever you put a '$D'
in the title string, it is replaced by the current date DD.MM.YY.
'$E' works just like '$D' except that the date is displayed the
"English" way: MM/DD/YY. The title string may only include one
date. A specification like /T:"" will prevent the title from
being displayed.
By default, "This is today's ($E) quotation:" will be used as
title.
- Color Set ( /C:<colorset> )
You may choose from three different color sets:
- 1 = monochrome color set
- 2 = color (title lightred, frame yellow, text lightgreen on black)
- 3 = your own creation!
- '3' must be immediately followed by 6 hexadecimal digits
specifying your new color set. Every two digits combine for
a text color attribute in the following order:
-> Title Frame NormalText <-
The first digit indicates the background, the second one the
foreground color, e.g. '0F' would be white text on black.
Color codes are as follows:
Black 0 DarkGray 8
Blue 1 LightBlue 9
Green 2 LightGreen A
Cyan 3 LightCyan B
Red 4 LightRed C
Magenta 5 LightMagenta D
Brown 6 Yellow E
LightGray 7 White F
You may not use colors of the right column as background colors,
unless you want the whole thing to be blinking.
Example: -c:30C0E0A equals -c:2
I know this could have been designed more user friendly, but
after all, you've only got to do it once, so cheer up!
By default, the 'color' color set is activated (option 2).
- Framing Lines ( /L:- ) [not a smiley]
If you feel disturbed by the frame lines, you may turn them off
by using the -l option. Any other character but the minus sign
following the colon will cause the frame to be displayed.
That is also the default.
- The option you should never use: /a
Normally, QUOTS will pick a quotation for every day and display
the same one all the time on one day. If you can't wait to see
another great quotation from your database, you might want to use
this option to make QUOTS display a new quotation every time it is
called. However, the displayed quotation would no longer be some kind
of 'motto of the day', and that's bad.
QUOTS will still store the information about the last displayed
quotation in the corresponding qfile. So when you're calling QUOTS
again with the same parameters except /a, it will display the last
quotation for the rest of the day. Now if you don't want that, you
may specify /an, which makes QUOTS forget about the quotation it has
just displayed. The last saved information will remain untouched,
so unless the date has changed, the next call without the /a
parameter will bring up the old quotation again.
- Counting Quotations
Having acquired the first 100 KB of quotation files, I wondered how
many quotations they might contain. So I decided to give QUOTS the
ability to count them. What it does is count all the quotation
seperators ('%%') in the file. So remember to put one behind the last
quotation in your file, too, because if you don't QUOTS won't count it.
In order to count quotations, the very first command line parameter
must be '/count', followed by a list of quotation files. This time,
there is no limit to the number of files except DOS's PSP.
When counting quotations, no quotation will be displayed. QUOTS will
not check whether the given files are valid quotation files. If you
specify junk files, the result will probably be zero, or maybe
something very weird.
Example: QUOTS /count a_file b_file c_file
For a better understanding of how the command line options work together,
I have provided the following examples for complete program calls:
- (a) QUOTS quots.qts -c:3090E07 -t:"" nice.qts 5000 bgsaying.qts 10000 english.qts
- This is how QUOTS is called in my autoexec.bat file. The quotation is
chosen from one of the four given files. "english.qts" is the biggest
one (500 quots, 70,000 bytes), whereas the other three are relatively
small. "nice" contains nice quotations that are a little too long, so
I don't want to have them displayed too often (probability like a
5000 bytes file).
QUOTS displays the chosen quotation using light gray text and a yellow
frame on black background. There is no title.
- (b) QUOTS myquots.qts
- Displays a quotation from "myquots.qts" with all the default settings,
i.e. title, color set, frame, ...
- (c) QUOTS
- Tries to open "quots.qts". If successful, see (b). If not, QUOTS will
display a short help screen with brief instructions on usage etc.
The latter can also be achieved by typing in "QUOTS -?". This comes
in handy when there is a file "quots.qts", but you still want to
see the help screen.
- (d) QUOTS lotsofqu.ots -l:- -a
- Displays a quotation from "lotsofqu.ots" just like (b), except that
the frame is ommitted, and a new quotation is chosen whenever the
program is called, regardless of date.
5.) Contacting the Author
If you feel a strong urge to throw up because you've read this, feel
free to do so. For other, more constructive criticism, ideas for bug
changes, or praise(?) you may contact me by e-mail. (For e-mail bombs,
the stress is on e!) Remember: Don't Panic!
Documentation is like sex: When it is good, it is very, very good;
and when it is bad, it is better than nothing.
-- Dick Brandon
Here's the address: public(at)thomasjensen.com
6.) Downloading quots
The link below gets you the quots self-extracting archive.
Under DOS (sure) all you have to do is type quots-x while you're
in the directory you want quots to be installed in, and it will upack.
You're all set.
HAVE FUN !
"... A booming voice says, "Wrong, cretin!", and you notice that you
have turned into a pile of dust."
quots
© 1995 by Thomas Jensen
<public(at)thomasjensen.com>
Page created February 2, 1995, last modified: 09/23/96.
All rights reserved.
Location: https://thomasjensen.com/software/quots/