THE MANUAL ----------------------------------------------------------------------------- Firstly, let me apologise for the lack of formatting in this manual. The text was exported from Calamus in ASCII format. Registered users get the laser printed Calamus/Outline Art manual. On with the manual... ----------------------------------------------------------------------------- INTRODUCTION Fastbase is a powerful, flexible database for the Atari-ST that incorporates features previously only to be found in expensive commercial offerings. The many features include: * Incorporate 4 different graphic formats * Multiple databases in memory at once * Sophisticated query with relational features * Works in all three screen resolutions * Two password protected access levels to databases * Works comfortably on a 520 ST * GDOS compatible for ultimate on-screen presentation RUNNING FASTBASE Simply double-click on "FASTBASE.PRG". FastBase will auto-load and present you with a desktop and a menu bar. INSTALLING FASTBASE If you are using the unregistered shareware version of FastBase, the install option is not available. Registered users should select the "Install" option from the "File" menu. A dialogue box will be displayed. Database definitions, their associated fields, and of course the records themselves all take up memory, and this is where you set those memory levels. You can have up to 22 databases in memory at any one time. These databases may have no more than a total of 200 fields. The amount of record memory is only limited by your computer's RAM. The "menu flashes" number indicates the number of times that a menu item flashes when clicked upon. This is purely aesthetic and may appeal to Macintosh users. The "backup level" is used by the incremental backup facility used by the "Save file" option. The number entered here indicates the level to which the backup facility will preserve old files. Selecting the "Custom file selector" button causes FastBase's custom file selector to be used whenever a filename is required. Users of powerful replacement file selectors may wish to switch this option off. "Error screen flash" and "Error beep" are effects used when you try to do something impossible whilst using the custom data input routine. When you are satisfied with your selections, click on "Save" to save them to disk, or "Cancel" to abort. Due to the ST's architecture it is necessary for you to quit and reload the program before these new settings can come into effect. CREATING A NEW DATABASE Before creating a new database you should decide on what fields you require. The decisions you make now are very important because it is very hard to add or delete fields after a database has been created. When you have decided on your fields, select the "Create new" option from the "Database" menu. You should supply a name for the new database that is different from any others currently in memory and, optionally, passwords for the two levels of access. If you do not specify any passwords then you will have access to all database functions at all times. If you try and load a password protected database from disk, you will be prompted to enter the passwords. If you enter the user password correctly then you will be allowed to browse freely through the database, but not alter it's data. If you get the supervisor password correct you can freely do anything with the database. When you are satisfied, select "Okay" to define the fields required by the new database. DEFINING FIELDS There are four distinct types of field available within FastBase. They are Textual, Numeric, Calculated formula and formatted date. The amount of fields available is determined only by the number set in the "Install" dialogue. To define a field, first decide on it's name. This must be unique within the database and may include spaces if you so desire. Next decide what type of field this is to be, and click on the appropriate button. If the field is so important that all records in the database must have valid data entered into it, then select the "Required" button. You may now decide on any special formatting options that the field is to have. This is non-essential as it is possible, and simpler, to set the formatting options later on when you can see the results immediately. To set the options, double-click on the field type button that you selected. When the field name and options are correctly set, click on the "New" button to add the field to the list in the window. To amend a field definition, first click on its name in the list window, then make the necessary amendments, and finally click on the "Amend" button. To delete a field, click on it's name in the list window, and then on the "Delete" button. When you are satisfied that the list of fields in the window reflects the fields that you require in your database, click on the "Okay" button. You will not be allowed to leave this stage with no fields defined. You are now in a position to manipulate your database, and will have been accorded supervisor access to it. OPENING A WINDOW Naturally, in order to view your database you need to open a window. To do this, select the "Open window" option from the "Database" menu. The window that appears may be moved and resized freely within the confines of the screen. The vertical arrows and sliders are used to move between records within the database. The horizontal sliders and arrows are used exclusively to change the portion of any image being viewed. ADDING A RECORD To add a new record to the end of your database, select the "Add new" option from the "Record" menu. Your fields will be displayed in a list, ready for you to enter data. Simply type in the field data using the cursor keys to move between fields. Text fields may be up to 1000 characters long - the line will scroll as required. Extra keys available whilst using this custom input routine can be found listed later in this manual. Numeric fields should, obviously, contain only valid numeric characters. Don't bother to enter anything in the calculated fields, the contents will be calculated for you. Date fields should contain a date made up of numbers separated by any non-numeric character, in the order specified when you created the field. If a field has been marked as "Required" you must enter something into it, and will not be allowed to move off it until something has been entered. When you are satisfied with your data, press Control-Return, or Undo to abort. DISPLAYING FORMATTING When first viewed, the record display looks most unappealing and could definately do with some sprucing up. Firstly, you can move the fields around the window using the mouse. Simply click on the field and drag it to a new position. To aid your positioning, holding either Shift key down when you release the mouse button results in the field being snapped to the nearest character boundary. Secondly, any field may have it's characteristics changed by double clicking on it. A popup menu will appear containing the options relevant to that type of field. The options for date and text fields are glaringly obvious and you are encouraged to experiment with them to achieve the desired effects. The numeric and calculated fields share the same options, which require a little explanation. Blank: If the number is zero, nothing is displayed. Brackets: Negative numbers are displayed in brackets, accountant style. Commas: Commas are inserted to make large numbers more readable, eg 1,000,000. Currency: A prefix of up to 5 characters is displayed before the number. Use the "Set","Currency text" option to define the currency text for the field. Graphical: Displays a pseudo graphical display of asterisks, corresponding to the number's magnitude. Integer: Numbers are displayed without their fractional components. Percentage: Numbers are multiplied by 100 and displayed with a trailing '%' symbol. Dec. Places: Numbers are displayed with a fixed number of decimal places. Use the "Set", "Decimal places" option to define the number of places to be displayed. Scientific: Numbers are displayed in scientific exponential format. Suffix: A trailing string of up to 10 characters is displayed after the number. Use the "Set", "Suffix" option to set this suffix. Note that any of the above options may be combined to achieve the desired results. The "Set", "Formula" option is used to set the calculation formula that is used to determine the result of a calculated field. These formulae may be simple or complex, and bear more than a passing resemblance to spreadsheet formulae. Formulae are explained in greater detail further in this manual. The "Set", "Font" option is used to set the GDOS font used to display the field on screen. Fields may be displayed with, or without their names. Use the "Display" options, common to all formatting menus, to set this. It is possible to further enhance the display by adding a backdrop to the database. This is done by selecting the "Add" option from the "Database" menu, "Backdrop" sub-menu. You should use the file selector to pick a picture file from disk to use as the backdrop. The recognised file types are Degas (compressed and uncompressed), IMG, Neochrome and Tiny (TNY, TN1, TN2, TN3). Fastbase automatically senses the file type from its extension. The image file must be the same resolution as the current screen resolution. Once the backdrop has been loaded, you can reposition it within the window by clicking and dragging with the mouse. To remove a backdrop, select the "Remove" option from the "Database" menu, "Backdrop" sub-menu. ADDING IMAGES TO RECORDS In some applications it is useful to have images attached to records. For instance, a database of architect's work may have technical drawings attached to the images. To add a new image to a record, select the "Add" option from the "Record" menu, "Images" submenu. The file selector will appear from which you should select the name of the image file, which must be the same resolution as the screen. The image may be in either Degas (uncompressed or compressed), IMG, Neochrome or Tiny (TNY, TN1, TN2, TN3) format. The image format is automatically sensed by FastBase, using the extension of the filename. Note that to save space, only the filename of the image is stored, and the image is loaded whenever required. The icon that appears with "View image" written inside it may be dragged to a desirable position on the screen using the mouse. Single clicking on this icon causes the image file to be loaded from disk and displayed in the window. You may scroll around it using the vertical and horizontal window controls. When you have seen enough, click on the window's close box to return to the normal database display. To remove an image from a record, select the "Remove" option from the "Record" menu, "Images" submenu. When you add an image to a record, it's entire pathname is stored, complete with the disk drive from which it came. If this poses a problem when you copy your database to another disk drive, then you will need to use the "Edit path" option located in the "Record" menu, "Images" submenu. The current pathname will be displayed for you to edit. If you omit the drive specifier completely then drive dependencies will be eliminated. EDITING RECORD DATA If, for any reason, you wish to make an alteration to the data in a record, simply ensure that the top window is displaying that record, then select the "Edit this" option from the "Record" menu. The same window appears that is used when you add a new record, except this time it contains the record data for you to alter. Simply make the necessary modifications and then press Control-Return to amend the record, or Undo to abort. DELETING RECORDS To delete a record from the database, select the "Delete" option from the "Record" menu. If you have any selected records, you will be offered the chance to delete these instead (see next chapter for explanation of "selection"). Note that deleted records are irretrievably lost and cannot be salvaged. FORMULAE Formulae used in calculated fields may be simple, for example... Unit cost*quantity ...will calculate the product of the two fields "Unit cost" and quantity. The formulae may also be highly complex, involving functions and nested brackets... @sqrt(@cos(field/2)) ...calculates the square root of, the cosine of, half the value of "field". The functions @sqrt and @cos may be in upper or lower case letters, and are part of a large list of available functions, listed below. FORMULAE FUNCTIONS + Addition - Subtraction * Multiplication / Division ^ Raise to the power of = Test equality < Test less than > Test greater than <= Test less than or equal to >= Test greater than or equal to <> Test not equal to @exp(x) Compute 'e' to the power of 'x' @abs(x) Absolute value of 'x' @int(x) Next lowest integer than 'x' @int2(x) Next highest integer than 'x' @ln(x) Natural logarithm of 'x' @log(x) Base 10 logarithm of 'x' @log10(x) As @log(x) @sqrt(x) Square root of 'x' @cos(x) Cosine of 'x' @sin(x) Sine of 'x' @tan(x) Tangent of 'x' @cosh(x) Hyperbolic cosine of 'x' @sinh(x) Hyperbolic sinh of 'x' @tanh(x) Hyperbolic tangent of 'x' @acos(x) Arc-cosine of 'x' @asin(x) Arc-sine of 'x' @atan(x) Arc-tangent of 'x' @not(x) Logical not of 'x' @day(field) Day of week (1-7) of date field, 'field' @month(field) Month of year (1-12) of date field, 'field' @year(field) Year of date field, 'field' @fact(x) Factorial of 'x' @sign(x) Return sign of 'x' (1,0,-1) @mod(x,y) Returns remainder after dividing 'y' into 'x' @round(x,y) Round off 'x' to 'y' decimal places @and(x,y) Both 'x' and 'y' must be non-zero to return a true result @or(x,y) Either 'x' or 'y' may be non-zero to return a true result @xor(x,y) Logical exclusive or of 'x' and 'y' @if(exp,true,false) If expression 'exp' evaluates non-zero, then 'true' is executed, else 'false' is executed. @pi Returns pi (3.141592653589793 etc.) @true Returns 1 @false Returns 0 Note that all the parameters referred to as 'x', 'y', 'exp', 'true' and 'false' may themselves be nested formulae containing references to fields where numbers are required. Remember that spaces are significant as they are used in field names. SORTING THE DATABASE Just about every database will require sorting every now and then, particularly after you have added some new records. It is always a good idea to consider which field you are going to sort by when you create the database, and make it a "required" field. To sort the database, select the "Sort" option from the "Process" menu. You are only required to enter the field by which you are going to sort, and whether the sort is to be ascending or descending. Click on "Cancel" to abort the sort, or "Sort" to proceed. After a short delay which varies depending on the number of records in the database, you will be returned to the normal display. SELECTION To aid you in the task of selecting only the records that you wish to see, Fastbase introduces the term "selection" which may be applied to any records in a database. Selected records may be extracted to disk, printed separately etc. A selected record is marked with a tick in the upper left hand corner of it's window. To toggle the selected status of a record, use the "Toggle this" option from the "Record" menu, "Selection" submenu. To select all the records in the current database, use the "Select all" option from the same menu. Similarly, the "Deselect all" option deselects all records in the current database. The "Reverse" option selects all deselected records, and deselects those that are selected. In addition to these functions, the search function allows automatic selection for matching records, increasing the power of the facility enormously. Pressing Control-Down takes the display to the next selected record in the database. Conversely, Control-Up takes the display to the previous selected record. SEARCHING THE DATABASE To search for one or more records in the current database, select the "Search" option from the "Process" menu. The "Filter:" text requires you to enter a formula, in much the same way calculated field formulae are entered. This formula is applied to every record, and, if the result is non-zero then a match has been found. All the functions available to calculated fields are available, and several more to allow text fields to be used in the filter. The extra functions are: @left(text,count) Use the leftmost 'count' characters from "text" @right(text,count) Use the rightmost 'count' characters from "text" @mid(text,disp,count) Use 'count' characters, taken 'disp' characters from the left of "text" @instr(text,subtext) TRUE if "subtext" appears within "text", else FALSE @strlen(text) Returns the number of characters in "text" In addition to these new functions, the filter allows you to refer to parallel records in another database. This feature can be extremely powerful, as it allows relational links to be created between well organised databases. The general format of a reference to a field is... database.field ...If you do not specify a database name then the field is assumed to come from the current database. For example, the filter... @instr(The World.Religion,"islam") ...will match all records from the example database "The World", where the religion field contains the text "islam". The search is not case sensitive. Another example is... @or(Adult literacy>.5,Life Expectancy>50) ...will match records where the adult literacy rate is greater than 50% or the life expectancy is greater than 50 years. The "From first" button starts the search from the first record in the database, the "From this" button starts the search from the currently displayed record. Click on the "Search" button to display matching records in the window, with the "...next" menu option taking you to subsequent matching records. The "Select" button causes the search to pass automatically through the database, marking matching records as "selected". PRINTING There will always come a time when you want to send one or more of your records to the printer. To do this, ensure that the correct database is showing, then select the "Print" option from the "Process" menu. If you want to start printing from the first record in the database, select the "From first" button. The "From this" button starts printing from the currently displayed record. The "All" button prints all records from the chosen start record. The "Filter" button prints only those that match the supplied filter, and the "Selected" button prints only those marked as selected. (See the search option for an explanation of filters). Ensure that your printer is connected and ready to accept data before you click on the "Okay" button. To abort printing, hold down the Alternate key until the "Aborted" message appears on the screen. QUERYING THE DATABASE Queries provide the most powerful and flexible method of interrogating your database and customising the reporting of results. To enter a query, select the "Okay" option from the "Process" menu. The "Name" is simply a short description of what the query does, and is for your reference only. The "Filter" is a filter that operates in the same way as that used by the search option, and is described previously under that heading. The "Report" is a string that defines what is reported about records that satisfy the filter. The general format is: [item][separator][item][separator]... The items are either field names with optional databases preceding them, quoted strings or formulae in single quotes. 1) Fields that come from the current database need only have their names specified, else the database.field format is used. 2) Strings are to be surrounded by double quotes ("), and will be output unprocessed. 3) Expressions within single quotes are evaluated as formulae and their results are output. The separators can be any one of the following... , Output a horizontal tab character - Don't output anything | Output a new line ~ Output a form feed For example, using the world example supplied on disk, the report string... "Country: "-Name| ...will report the country name preceded by "Country: ". The new line ("|") is required so that the next report will be on the next line. The "Screen", "Disk" and "Printer" buttons define where the report is to be sent to. If you select the "Disk" option, you will be required to give a filename for the report. The "Load" button loads a query definition from disk and places it in memory. You may have up to 20 queries in memory, and use the "Select" button to pick and choose them as you require. The "Save" buttons saves a query to disk that must previously have been added to memory using the "Add" button. The usual intuitive popup menus are used to select queries The "Delete" button is used to remove a query from memory, freeing it's space for another query. Any queries that you save to disk in the same folder as FASTBASE.PRG will be auto-loaded when you load FastBase. Queries should all be given the extension of ".QRY". There are several query examples supplied on the disk that you should examine and experiment with. They all relate to the "The World" database supplied as an example. To pause the output of a query, press and hold down either of the shift keys. PRINTING A MAILSHOT Enter another powerful feature of FastBase. Ever wanted to send a personalised letter to friends, clients or customers ? Well now you can by selecting the "Mailshot" option from the "Process" menu. After you have entered the relevant options, which are identical to the "Print" options, described above, the file selector will appear. You should use it to pick the text file to use as a template for the mailshot. This text file should be pure ASCII as saved by all text editors and exported by most word processors. The text file should contain special commands to indicate data that is to be inserted into the file. These special codes are contained in curly "set" brackets, and are listed below: {date} Inserts the current date into the text {right} This line will be flushed against the right margin {centre} This entire line will be centralised {linelen x} The maximum length of each line is set to 'x'. The default line length is 72 {lm x} Sets the left margin to 'x' characters {wrap on} Switches auto-word wrapping on, this is the default {wrap off} Switches auto-word wrapping off Any other text found within the curly brackets is assumed to be a field name (with an optional database specifier). The contents of that field will be inserted into the text. The file "MAIL.TXT" gives an example of a mailshot, when used in conjunction with the example database "ADDRESS.FB" SAVING YOUR DATABASES To save any or all of the databases in memory to disk, select the "Save" option from the "File" menu. If you have more than one database in memory you will be given the option of saving them all within one file. Use the file selector to choose the name of your new file, being sure to give it an extension of ".FB.". Old files may be backed up, with older files being further backed up, thus maintaining a history file of changes to the file. You set the level of this incremental backup using the "Install" option. LOADING A DATABASE To load a database file, you should select the "Load" option from the "File" menu. Use the file selector to pick the database file which will be added to those in memory, subject to any password checks being successful. EXTRACTING RECORDS The "Extract" option, located in the "File" menu allows you to save the selected records in a database, as a separate database file. Naturally, you must have some selected records in the database to save. Use the file selector to pick a name for the new file. EXPORTING RECORDS Many popular packages, this one included, have a facility for the import of comma separated ASCII files. The "Export" option, in the "File" menu, allows you to produce these files from the currently open database. If any records in the current database are "selected" then you may choose to export just these records. IMPORTING DATA If your previous favourite application (before you discovered this one !) allowed the export of comma separated ASCII files, then you may import them into a FastBase database. The field data in the file must be separated by commas, with the end of a record being signified by a new line. The data will be added on to the end of the current database. The normal procedure for importing data is to create a file with no records, and then import the new data into it. You will be asked to pick the name of the file to import using the file selector. DATABASE INFORMATION To get some informative statistics about any of the databases currently in memory, select the "Information" option from the "Database" menu. If you have more than one database in memory, clicking on the "Select" button presents you with a menu to pick a database from. The amount of memory left decreases each time a record is added to memory, but does not go up when you delete one. If you find yourself without memory, save your files and quit. Reloading the program and your data files should give you more memory. RENAMING A DATABASE To change the name of a database, and it's passwords, select the "Rename" option from the "Database" menu. The dialogue box is identical to that used when you create a new database. You should edit the information in the dialogue box to your satisfaction. DELETING A DATABASE To delete an entire database, select the "Delete" option from the "Database" menu. You will be asked to confirm this rather drastic selection. Note that deleting a database does not free up it's memory. To do this you need to save your work, quit the program and reload. THE TOOLBOX To some users, having the toolbox on the desktop may be irritating, especially in low resolution. To stop the toolbox being displayed with a particular database, ensure that it is in the top window, the select the "Desktop toolbox" option from the "Database" menu, "Display" submenu. A tick next to the menu option indicates the presence or absence of the toolbox. IMAGE DISPLAY As documented earlier, you can add an image to a record and view it by clicking on an icon. By selecting the "Integrated images" option from the "Database" menu, "Display" submenu you can display the image integrated into the record display. This is only really useful for high resolution monochrome hard disk users as the image's colours should ideally match the backdrop. Secondly, the image is reloaded whenever it needs to be redrawn, and this can cause an unacceptable delay for floppy disk users. To position the image within the record, click on it with the mouse and drag it to the required position. GET USED IT The FastBase user environment is almost identical to the standard GEM interface that you are used to. However, there are a few subtle requirements that you should know about. THE MENU You will notice almost immediately that some menu options have submenus attached. These allow related options to be grouped together, as seen on the Macintosh, Amiga, Archimedes and practically all other modern computers. If a menu item has a letter printed in red, or underlined in high resolution, then it may be activated by pressing Alternate and that letter. I WANT MY ACCESSORIES The standard menu makes no provision for desk accessories. If you want to use one, press Escape. A GEM menu bar will appear from which you may select a desk accessory. Press Escape to return to the standard menu bar. DIALOGUE BOXES Some minor improvements have been made to dialogue boxes. All of them may be dragged around the screen by clicking on the black title bar. If the dialogue box has no text fields, "Return" terminates the dialogue via the default button (the one with the thick border). Otherwise "Return" takes you to the next text field, and "Control-Return" terminates the dialogue box. The Undo key will terminate the dialogue box through any "Cancel" button. ALERT BOXES The alert boxes always appear where the mouse pointer is, and if possible, with the pointer over the default button. They may be dragged around the screen by grabbing the diagonal line at the top left of the box. "Return" terminates the alert box via the default button, and Undo selects any button called "Cancel". THE TOOLBOX The toolbox may be used as an alternative to the menu or keyboard when selecting menu options. THE INPUT HANDLER The input handler is what you use to type in field data, formulae etc. It can be determined from the standard GEM input handler by the "thick" black cursor it uses. This input handler uses several control keys to give you access to it's features:- Shift-left Go to start of line Shift-right Go to end of line Control-A Go to previous word Control-F Go to next word Control-Q Delete to end of line Control-L Convert character at cursor to lower case Control-U Convert character at cursor to upper case