home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 5 / Amiga Tools 5.iso / tools / developer-tools / amos-tools / eaissue3a / text / database_tutorial_2.asc < prev    next >
Encoding:
Text File  |  1996-07-13  |  5.5 KB  |  125 lines

  1. ü
  2.                        Database Tutorial - Second Part
  3.                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  4. û
  5.         Hello and welcome to the second part of my Database tutorial. In
  6.     the last doc, we looked at a simple phonebook as an example. Again, I
  7.     shall be using a phonebook method, but will be implementing newer
  8.     options into the program, so that you can learn how to adapt them into
  9.     your own programs.
  10.     
  11. ÷
  12.         The main option we will be looking at this time, is multi-field
  13.     file searching. This is an essential in most cases, as you would often
  14.     know the phone number of someone, but don't know who it belongs to. A
  15.     search option could be used to look for the number. Other good field
  16.     searches are towns, and e-mail numbers.
  17.     
  18. ù
  19.         Because I am going to change the layout of the program a little, I
  20.     will have to change the structure of which it saves and reads files. I
  21.     have around 60 entries on my data disk using the old program, and
  22.     because I am a nice guy, I have also written a converter, which just
  23.     so happens to change your old files, into compatability with the new
  24.     system. See the section labelled PROGRAM CHANGES for more information
  25. ÿ
  26. ù
  27.     on why.
  28.     
  29.         I am also introducing a system of PowerPacking files down a little
  30.     bit, to save space on the data disk. In order for this to work, you
  31.     must have the Compiler.Lib extension in AMOSPro, and
  32.     POWERPACKER.LIBRARY in your LIBS: drawer. If you do not have the
  33.     extension, then changes in the program will be added at the bottom.
  34.     
  35. ý
  36.       Program Changes
  37.       ~~~~~~~~~~~~~~~
  38. þ
  39.         Several changes have been made to the mainframe workings of the
  40.     program. The most important being, that the system no longer uses
  41.     multi-file access. All possible records are stored in one big file,
  42.     which is kept in the memory. This means that when a search is called,
  43.     the command HUNT can be used, which is the fastest way of finding
  44.     strings in the AMOS memory.
  45.     
  46.         As I mentioned before, I have implemented Powerpacker, a file
  47.     cruncher which reduces the size of the file saved to the disk, yet is
  48.     unpacked to the correct size when loaded back into memory. This only
  49. ÿ
  50. þ
  51.     kicks in when the file to be saved is over 50K, which is around 10-12
  52.     records minimum. PowerPacker has a crunch rate of around 45% on 
  53.     average. In order for PP to work, you will need the Compiler.Lib of 
  54.     the AMOSPro Compiler extension, and the POWERPACKER.LIBRARY in the 
  55.     LIBS: drawer of your bootdisk. If you don't have the facilities for 
  56.     the powerpacker commands, then I will also document on how to use 
  57.     standard AMOS commands. If you have Classic AMOS, then it is possible 
  58.     for you to use the EASYLIFE extension, providing you have it, which 
  59.     saves pure powerpacker files, where as the AMOSPro files are saved 
  60.     with a special AMOS header, so that they can be recognized when they 
  61.     are loaded back in. Easylife files can be crunched and de-crunched 
  62.     with a standard powerpacker program.
  63.     
  64. ú
  65.         The program will now open a small prefs file, which controls some
  66.     extremely simple options, mainly being the way that the data is saved.
  67.     You can change the size of the executable before it is powerpacked, as
  68.     well as if it is to be crunched at all, and if the main data file is
  69.     to be saved after every new entry. This is a lot faster on a HD
  70.     machine, and is only reccomended that a HD version has this option
  71.     turned on, unless the floppy version is a very small file.
  72. ÿ
  73. ø
  74.     
  75.         Apart from the above, only minor changes have been made to the
  76.     system. Everything has been iggledy-piggledy'd around, but still runs
  77.     exactly the same, with no further new additions.
  78.     
  79. ü
  80.                                Getting Started
  81.                                ~~~~~~~~~~~~~~~
  82. ù
  83.         In case you didn't follow the last tutorial, all features in their
  84.     new form will be documented in full, as I will need to inform you of
  85.     any changes that I have made. All programs (as usual) will be included
  86.     on the SOURCE drawer, on disk 2 of this issue. If not, then you can
  87.     get in touch with me at the address at the end of this file, where I
  88.     will be happy to sort you out with the appropriate programs.
  89.     
  90. ý
  91.       Important Note
  92.       ~~~~~~~~~~~~~~
  93. ú
  94.         Because of the nasty bugs that are in AMOSPro, the program may
  95.     sometimes crash when the PPSave command is used. I also will be using
  96.     an EXECALL function (alters the system) to help speed things up when
  97.     the disk drives and keyboard are not in use (mainly when searching),
  98. ÿ
  99. ú
  100.     and if the program is brought into editor mode whilst the call is
  101.     active, then it will definately crash if the menu is called up. What I
  102.     am trying to say is SAVE YER SODDIN' WORK FIRST !!
  103.     
  104. û
  105.         OK, the rest of the tutorial is about explaining the program
  106.     itself, and so the best way to do that I feel, is to actually place
  107.     all of the comments in the actual program listing !! See ya over
  108.     there, dudes !!
  109.     
  110. ý
  111.         Remember, the address to write to me with any kind of problems, or
  112.     if you have any programs or tips, or just want to chat, then write to :
  113.     
  114. û
  115.                           Andrew "Mushroom" Kellett
  116.                                  Mushroom PD
  117.                             32 Castleton Crescent
  118.                                    Gamesley
  119.                                    Glossop
  120.                                   Derbyshire
  121.                                    SK13 9TH
  122. ÷
  123. EOF
  124.  
  125.