
                    INSTRUCTIONS FOR MULTIFILE PROGRAM


BEFORE YOU LOAD THE PROGRAM

This  BBC  BASIC program for the Archimedes/A3000 has been slightly altered
from a version for use on a BBC  Micro  or  Master.  It  is  able  to  take
advantage  of  the extra speed and memory of the Arc, and will operate with
either the ADFS or RAM filing systems. It has been tested  under  RISC  OS,
not Arthur.


CUSTOMISING THE PROGRAM

From the desktop, press <F12> to get a "*" prompt, then type
MOUNT
DIR $.!Multifile
LOAD "MultiFile"

If you have a suitable printer, then you should set the appropriate options
in lines 1540 to 1560. Those given are suitable for Epsons, (and compatible
types  such  as  the  Canon or Kaga-Taxan), although the setting of *FX8 in
line 1560 only applies to printers using the RS423  serial  port.  If  your
printer  fails  to  feed  the paper during printout from the program, alter
line 1550 to *FX6,0 and if you get double-line spacing alter it to *FX6,10.
If  you  are  not  using an Epson-compatible printer you should delete line
1570, and if you are using a wide-carriage printer such as  an  MX/FX/RX100
etc,  you should alter it as shown in the REM statement. Using a printer is
dealt with in a later section. You can then Save your 'customised' copy  of
the program with SAVE, but do keep the original safe just in case.


LOADING THE DEMO FILE

RUN the program, and the first thing you will see is  the  Primary  Options
Menu, and it is from this point that major file operations are carried out.
If you press <Escape> at any time, which shouldn't normally  be  necessary,
then  you  will be returned to this menu. You can also enter a selection of
"*" Operating System commands, which mostly  relate  to  disc  drives,  and
these are dealt with in a separate section. Try selecting options 2,3 or 5,
and see what happens. (Note that the flashing arrow cursor  indicates  that
the  program is waiting for a single-key entry, whereas the normal flashing
underline cursor means that you need to type something in  and  then  press
<Return>.  From now on it is assumed that you know this). Now select option
4 for Load File. Date entry is  automatic,  (and  of  the  form  dd.mm.yy),
thanks  to  the  built-in real-time clock. Now specify the name of the file
required,  press <Return>, and wait while the  data  loads.  A  bleep  will
sound to tell you when the file is Loaded, and the first record in the file
will be displayed on the screen. Have a good look at  all  the  information
shown. At the top left is the filename, and at the top right is the current
date which you entered earlier. Just underneath that is the date  when  the
file  was  last Saved, so you know how up-to-date it is. Below that you can
see the actual file data. On the left are the 'field' headings,  NAME,  AGE
etc., and on the right are the individual record details. Under these there
is a menu which is concerned with file manipulations, and this part of  the
program  is  listed  in the Primary Menu as "View/Edit File". Press <P> for
Primary options, and then select option 2, View/Edit  File,  and  you  will
find  yourself  back where you started. Never use <Escape> as a lazy way of
getting back to the Primary Menu; nothing disastrous will happen, but  it's
a bad habit to get into.


MODIFYING FILE DATA

Looking at the screen again, you will see  that  in  this  particular  file
there  are  four  fields,  numbered  1  to 4 on the left, and Record No. is
effectively fixed as field 0. These fields are user-definable, and you  can
have up to nine of them. The first record in a file is always Record number
1, and in this case, the last one is number 15, as shown  above  the  menu.
The  figure  3000  shows  the  maximum  number  of records possible, memory
permitting, and will vary depending on how many fields are defined, and how
much  memory has been allocated to BASIC. If you press <N> for Next Record,
record 2 will appear, and if you hold the key down, you will  step  quickly
through the file. If you go beyond the last record then you will be back to
record 1, and vice-versa. Pressing <L> for Last  Record  has  the  opposite
effect.  You  can  jump  quickly to a particular record by pressing <J> for
Jump Record, and typing in the  particular  record  number  you  want,  and
pressing  <Return>.  Next, you can try altering something, so press <H> for
New Heading, select field 3, type in "YEARS", and  you  will  see  the  new
heading  appear on the left. Now press <M> for Modify Data, select field 4,
type in "BRIGHTON", and you will see the new data appear on the right.  You
can  now  see how easy it is to update your files, or correct any mistakes.
To abort, press <Return> instead of selecting a field number.


ADDING EXTRA RECORDS

You  can now try adding a couple of records of your own by pressing <A> for
Add Record. You can now type in details of your  family  and  friends,  but
don't worry if you make a mistake; you can easily correct it later. You can
type in up to 20 characters for each field,  and  it  doesn't  matter  what
letters,  figures  or  punctuation  you  use,  although it is safest to use
capital letters and minimal punctuation,  for  reasons  which  will  become
apparent  later. When you have finished typing in extra records, just press
<Return> instead of typing in the next name, and the  program  will  assume
that  you  have finished. You can, of course, leave any of the other fields
blank by pressing <Return>, but field 1 is the  Key-Field,  and  cannot  be
left  blank;  you clearly cannot have a person with no name! To demonstrate
this further, press <M>, select field  3,  and  then  just  press  <Return>
without  typing in a new age. That entry will now be blank. Next, try doing
the same with field 1, and you will be asked  if  you  really  do  want  to
delete  that  record,  as  it would have no meaning without data in the key
field. If you answer <N> then the record will  be  preserved,  but  if  you
answer  <Y>,  it will all be deleted, and the key-field will simply contain
the message "~~ DELETED ~~". You can type in fresh details  later,  if  you
wish, by using <M>, but you must start with field 1 before you will allowed
to enter data in the other fields. Alternatively, you can completely remove
deleted records from the file by using the Sort facility.


SORTING FILE DATA

You will notice that the records are not in any particular order, so  press
<S>  for Sort File. Select field 1, and then press <A> for Alphabetic sort.
After a few moments, (longer with larger files, of course), record  1  will
appear, and if you step through the file, you will see that they are now in
ascending alphabetical order of names, which is why the initials are  after
the  surnames.  Note that if, and only if, you do an alphabetic sort on the
key-field, any deleted records will be completely removed from the file. If
you  sort  alphabetically  on any other field, deleted records will tend to
migrate to the beginning of the file. Now press <S> again, and select field
3  and <N> for Numerical sort. (Press <Return> instead of a field number to
abort). This time, you  will  find  that  the  records  are  in  descending
numerical  order  of  age.  Note that the alphabetic sort actually sorts in
ASCII code order from the left, so numbers come before upper-case  letters,
which  come before lower-case ones. As a result, whole numbers will only be
in true numerical order if they contain the  same  number  of  digits,  eg.
0999,  1000, 0045 etc.. With the numerical sort, numbers are in true order,
and any entry not starting with a number will be pushed to the end  of  the
file.


TOTALISING A FIELD

Press <T> for Totalise, and select field 3.  (Again,  you  can  abort  with
<Return> if necessary.) You will then be given various statistics about the
age field, including the total number of people, the maximum,  minimum  and
average  ages  etc..  The  Coefficient  of Variation is simply the Standard
Deviation expressed as a  percentage  of  the  Mean,  and  is  really  more
appropriate  to  sets of statistical data. The Standard Deviation is worked
out on the basis of n-1 entries, so files of only  1  record  will  not  be
totalised, to avoid division-by-zero problems.


SEARCHING THE RECORDS

Earlier, you found how to jump quickly to a particular record  number  when
you  already  know  which  number  you  want,  but  there are other ways of
searching. Press <F> for Find Record, and select field 2.  (You  can  abort
with  <Return>,  as  before). Type in "MAL", (no need to spell it in full),
and all MALEs will appear. (Press <Shift> momentarily to scroll the  list.)
You  can  make  a  note  of which ones interest you, and when you press the
Space-Bar, the first of those valid records will be  displayed.  Try  doing
the  same  with  "FEM"  and  "MID",  and see what happens. Next, press <F>,
select field 3, and type in "5". This time,  since  you  entered  a  number
rather  than a string, you will have a choice of records with AGE equal to,
more than, or less than 5. Also, you can choose  all  ages  containing  the
character  "5";  ie.  the  same as the string search. Try searching for all
NAMEs containing the string "SMI", all TOWNs containing "LEE",  all  people
over  40  years  old,  and  so on, until you have got the hang of it. Don't
panic and go pressing <Escape> if you get in a bit of a muddle; if you look
at  the  screen and think carefully, you should always be able to see where
you are, and what to do next. Note that an entry like "Leeds" would not  be
found by searching for "LEE", so be careful about using lower-case letters.
As a last resort, you can always step through the file with <N> or  <L>  to
look  for  that  illusive misspelt entry! The program does its best to stop
you doing anything silly. Why not try to be bloody-minded, and deliberately
enter  ridiculous things to see what happens. Press <r> instead of <R>, try
and search for  record  number  "?",  press  any  key,  except  <Break>  or
<Escape>,  instead  of  what you are supposed to press. After a while, when
you find that your micro has not started to belch  smoke  and  flames,  you
will gain confidence rapidly!


SAVING A FILE

Press <P> for Primary Options menu, and then select option  5,  Save  File.
You can now press <Return> to accept the existing filename, or you can type
in a different one if you wish. Do not attempt to change the filename on  a
disc with *RENAME later, as the original filename is still contained within
the file, and so it will be reverted to next time the file  is  loaded.  Do
not  worry  if  the  new  name  is  shorter than the old one; the remaining
letters after the cursor will clear when you press <Return> again. Now, try
and  reLoad  the  file, so this time select option 4; notice the warning to
remind you that you already have  a  file  in  memory,  in  case  you  have
forgotten  to  Save  it. Press <Y> in reply to the question, and proceed to
Load the file, as before.


CREATING A NEW FILE

Now  you  can  try creating one of your own, so return to the Primary menu.
First, try selecting option 7, Exit Program, and note how you  are  warned.
Answer <N> to the question, and then select option 1, Create New File. This
time, answer <Y>, and you can start to create your own file. First, type in
the  current  date,  and  then  the  name  you  want  to call your file; 10
characters maximum each. Now you must decide how many fields you  need,  so
think  carefully, as you cannot add extra ones later, nor remove any. It is
a good idea to define one more than you think you need, just in  case,  but
don't overdo it, as this would waste valuable memory. Having done this, you
can press  the  Space-Bar,  and  then  type  in  your  field  headings;  10
characters  each  maximum.  Don't  worry if you make a mistake, because you
already know how easy it is to correct it later.  It  is  sensible  to  use
field  1,  the  key-field, for something that uniquely identifies a record,
such as Name, or Part Number, or Cheque Number etc.. Once you have  entered
the  headings you want, eg. Part Number, Street, Town or whatever, then you
can start to type in the actual file data, with a maximum of 20  characters
each.  The amount of free memory is shown at the bottom, and if you want to
squeeze as many records in as possible, then  don't  be  too  verbose,  and
avoid  unnecessary  punctuation!  The  maximum  possible number of records,
memory permitting, is given by the formula 12000/(number  of  fields).  For
example  with 4 fields this is 3000 records. This figure of 12000 is purely
nominal, (10 times the figure used on the BBC version in fact), and may  be
altered  in line 1760 if you wish. In the unlikely event of you running out
of memory, then you will be severely restricted in what file operations you
can  carry  out, so take care. When you have finished typing in records for
the time being, press  <Return>,  just  as  you  did  earlier  when  adding
records.


FREE MEMORY SPACE

You are hardly likely to run short of memory on an Arc, but you never know!
The best way to save memory, if you want to keep a large number of records,
is to avoid very long strings and unnecessary punctuation. You  do  need  a
certain  amount  of  'headroom',  as  a  small  amount  of memory is needed
temporarily every time a Function or Procedure is  used,  and  there  is  a
small  one-off  loss of memory space when you use a particular facility for
the first time. As you add records, or simply edit them, you will  see  the
free  memory  slowly  decreasing. When this gets very low, the "bytes free"
message will flash. Once you have reached this stage, some file  operations
will  no  longer  be  available, and these restrictions will become tighter
still as the free memory gets even lower, in order to prevent  the  program
from  crashing.  It  is wise to save the file at this stage, for safety. If
you then reLoad the file, you will regain some of this 'lost' memory, which
is  caused  by  discarded  character  strings  cluttering up the computer's
memory. (This is due to poor "Garbage Collection" in BBC BASIC).  The  Sort
File  option  is  not wasteful of memory, as the records themselves are not
actually sorted; only numerical "pointers" are changed.


PRINTING A FILE

You  can  print  out  all or part of a file, in a variety of ways. Assuming
that you have a suitable printer connected, and that the Arc is  configured
correctly,  (the  program  will 'hang-up' otherwise), that you have set the
printer options up as mentioned earlier,  and  that  you  have  a  file  in
memory,  proceed  as follows. From the Primary menu, select option 3, Print
File. From now on the default values shown in brackets after each  question
will  apply  if  you  press <Return>. Thus, if you wish to accept the value
shown, press <Return>, or else type in a new value. 

First, enter the width of your printer, or just press <Return> if 80 is the
normal  width.  Next,  keep  pressing  <Return> to accept all the following
default conditions, and after you have pressed the Space-Bar, the file will
be   printed  out.  You  can  abort  printout  by  pressing  the  Space-Bar
momentarily, (not <Escape>!), and then  waiting  a  few  seconds.  Now  try
printing  the  file  again,  but  this time enter, say, 40 columns for your
printer width, and see  what  happens.  If  you  have  an  Epson-type,  try
entering  132  columns, (233 on MX/FX100 etc), and condensed printing and 8
lines/inch will be selected. (This is done in line 1570, so alter it if you
want).  You can enter 22 columns, so that only one record is printed across
the page, and this is very useful for printing labels. You  can  alter  the
number  of  blank lines between each record to allow for the spacing of the
labels. If your file hasn't got too many fields, and the strings aren't too
long, try selecting 80 columns, Column printout, and 0 blank lines. This is
very useful for parts list, inventories, etc., although there  may  not  be
enough  room  across  the page, in which case you can try entering 132, (or
233), columns if you have an Epson-type. Owners of other types  of  printer
can  add  their  own  line 1570. (The first string of VDU statements simply
initialises the printer to normal print style etc., and the  second  string
after  the  IF statement sets condensed printing and 8 lines/inch spacing.)
Now try printing out, say, records  1  to  5  in  Column  mode,  with  full
headings.  Now  try  the  same  again,  but answer <N> to the full headings
question, and print out, say, records 9 to  12.  You  will  see  that  this
enables  you  to  print  out  selected parts of a file with only one lot of
headings at the top. You could also print out  several  similar  files  one
after  the  other,  under  a common heading. This can be very useful if you
need to split your records between several different files, due to lack  of
memory,  but  want  to print them out as one. (This isn't very likely on an
Arc). For example, you might have your holiday photographs split into files
for  1980,  1981, 1982 etc.. Try out all the combinations of the Print File
facility, so that you can see which format is best in future.


USING DISC DRIVES

It  will  be  assumed  that  you have already acquired a reasonable working
familiarity with the ADFS filing system. The data  filenames  must  not  be
more  than  10 characters long. You can include the directory specification
in the filename if you wish, but this is not recommended. If  the  filename
cannot  be  found  in  the  appropriate directory, the program will issue a
"File not found" message. You can obtain a catalogue of  the  current  disc
directory  by using Option 6 of the Primary menu. If you keep getting "File
not found", check that the file you  want  is  in  the  correct  drive  and
directory.  You  can change drive and directory from the Primary Menu, (see
next section). If you accidentally try to Load something which is not  file
data, you will get a "Type mismatch" error. The only error messages you are
likely when Saving a file are "Compaction required", (only if you are using
a  640k  L  format  or  800k D format disc), or "Disc full". The program is
supplied on an 800k  E  format  disc,  which  will  avoid  any  "Compaction
required" errors.


OPERATING SYSTEM COMMANDS

Option 6 of the Primary menu  can  be  used  to  '*CAT'  the  current  disc
directory,  without  losing  the file in memory. You can enter "*" commands
from the Primary Options Menu.  Eg, you can change disc with *MOUNT 1 etc.,
or  filing  system by typing *ADFS or *RAM. All "*" commands are permitted,
so you must be very careful indeed to avoid using ones which  will  corrupt
the  program.  Note that only a small window is available on the screen, so
only use commands like *INFO on specified files.


COPYRIGHT NOTICE

This  program  is  now in the Public Domain. Please feel free to distribute
UNMODIFIED copies to other parties, provided that it is not in exchange for
payment, and only if accompanied by this documentation file.

'Rick' Sterry G4BLT @ GB7YAX                          (C) BLT Software 1984
