Read the application's Help file first, then read this if you need more help
to figure out how to create a patterns file. You'll find it helpful to refer
to the Help file's tables of values alongside this text.

Here are some examples, mainly from my own Patterns file.

*.h				31
*.c				31
C source directories tend to contain a large number of files all of text
type, so the filetype icon isn't important, and a small icons display is more
useful to fit more on screen at once or take up less room on the desktop. To
set small icons we mask out the display options with 3 and set the value with
1. (I have several more lines like this for different types of source).

*.WordProc.Letters		CC
For letters you're likely to want to sort them by date. The sort options
are a little more complicated. C for the mask is easy to work out from
the table in the !Help file, but for the value we want to write 3 into bits
2-3, so shifting 3 left by 2 bits works out as C (the number in brackets).

*.!NewsDir.newsbase.debug%.*	FD
A certain set of directories used by Newsbase (the debug% can expand to
debugmail or debugnews in this case) contain lots of files where the
time/date is much more important than the name, so I have these sorted
by date and displayed as small icons. The mask to affect both types of
option is F, and we need to boolean OR (or add) the sort by date value
(C) with the small icons value (1), giving D.

*				1180031
You could have this at the bottom of a Patterns file to catch anything that
doesn't match any of the previous patterns in the file. It's an extended
option. The first digit 1 means use one set of options if there are fewer or
equal than a certain number of files in the directory, and another if there
are more than this number. That number is read from the next two digits in
hexadecimal, in this case &18 = 24. The next two digits are the options to
use for a low number of files, in this case 00 means no change from the
machine's configured options. The last two digits are the options to use for
a large number of files, in this case 31: use small icons.

*				310180031
Building on the previous example, this additionally checks the lengths of
filenames in the directory. If any files have more than 16 characters (&10 in
hex), or there are more than 24 files, it's set to small icons. If neither of
those conditions are true the options are left alone.

If using with RISC OS 4 you will need a final line that matches any filename
to ensure that directories not matching previous patterns are opened
consistently. If you do not want any of the extended options consider
something like:

*				F0

to use the factory defaults.
