48K/128 K SPECTRUM DATABASE II AUTOMATED FILING SYSTEM FORAITS SOFTWARE Foraits Software DATABASE II Instruction Manual CONTENTS Introduction ................................................... 1 Loading DATABASE II ............................................ 2 Creating a File ................................................ 4 Entering Records ............................................... 6 Saving & Loading Files ......................................... 7 Searching for Records .......................................... 8 Amending & Deleting Records .................................... 10 Sorting Records ................................................ 11 Printing Records ............................................... 12 Using the Screen Editor ........................................ 15 Miscellaneous Commands ......................................... 17 Glossary of Terms .............................................. 18 INTRODUCTION DATABASE II is an automated filing system for any 48K/128K Sinclair Spectrum. It will enable you to store groups of related information such as names & addresses, video or record titles, club membership details etc. Once stored, these items can easily be sorted, retrieved, viewed or printed depending upon the criteria you set. The program has been written entirely in Machine Code to offer the advantages of both speed and compactness. We believe DATABASE II is probably the simplest record storage system available for the Sinclair Spectrum. It isolates you from the technical detail so frequently necessary to operate other such programs. DATABASE II lets you concentrate on your data, not on the program. This manual is designed to initially be read in the order it is printed. Once you have read it, it is unlikely you will ever have to refer to it again. One exception to this order is the Glossary. This can be found at the end of the manual and should be consulted to clarify the occasional computer/database terms mentioned. If you find it necessary to refresh your memory on a particular topic the table of contents on the previous page clearly defines each section of the manual. Features a) Works with any 48K or 128K Sinclair Spectrum b) 64 characters per line are displayed c) Will store 32550 bytes of data per file d) All data is stored in the Spectrum's RAM for fast access e) Any number of records to a total of 32550 bytes may be stored f) A maximum of 20 fields per record is allowed g) Up to 50 characters per field may be entered h) Records may be sorted on any field in ascending or descending order i) Records may be printed via Interface 1 if fitted j) All commands are error trapped with appropriate messages output to the top line of the display k) Each field may be assigned various paper/ink colours to enhance the record format l) The last command typed is always available on the key for convenience Page 1 LOADING DATABASE II The DATABASE II program has been recorded on both sides of the cassette for your convenience. Just follow the appropriate instructions below to load the program:- All 48K Spectrums Place your DATABASE II cassette in your recorder and ensure it is fully rewound. Type the following command:- LOAD "" Once the above command has been entered you should start your cassette recorder. DATABASE II will load automatically and present you with the screen below. Stop the recorder at this point. Use of this file is described later in this manual in the 'Loading a File' section. All 128K Spectrum Place your DATABASE II cassette in your recorder and ensure it is fully rewound. Select the first option (Tape Loader) on the 128K menu and press the ENTER key. You should now start the cassette recorder to load the program. Once loaded you will be presented with a copy of the screen below. Stop the recorder at this point. The cassette contains a sample file of data after the main program. Use of this file is described later in this manual in the 'Loading a File' section. DATABASE II CUSTOMISER Cursor auto-repeat delay : 00000 Cursor beep length : 00000 Search upper/lower case discrimination? no UP/DOWN arrows to move cursor. LEFT/RIGHT arrows to change value Press ENTER when you made your selections Page 2 LOADING DATABASE II The 'Customising' screen gives you the choice of setting 3 options. Once set, these options will remain active until DATABASE II is reloaded. The options can be set by first highlighting the required line by the use of the up & down arrow keys. A description of the 3 options now follows:- 1) Cursor auto-repeat delay The value of this option determines the speed that the current key will be repeated. The default setting of zero will probably be suitable for your requirements. If you find it necessary to enter large amounts of data using the same character, it may be beneficial to try experimenting with this value. Use the left & right arrow keys to alter the value. A value of zero will disable the auto-repeat, a low value will provide a fast auto-repeat and a high value will slow down the auto-repeat. The acceptable range for this option is 0 - 255. 2) Cursor beep length The value of this option controls the duration of the beep for each time the cursor moves position. This also has the effect of altering the speed of the cursor. The value is changed in the same way as the above option. A value of zero disables the beep, a low value will provide a short beep and a high value will produce a long beep. The acceptable range for this option is 0 - 255. If a beep is required it is suggested a value of 20 is used as an initial setting. 3) Searching upper/lower case discrimination? Only 2 values are possible for this option - 'yes' or 'no'. As with the previous options the 2 choices are selected by pressing the left & right arrow keys. The setting of this option will affect the way in which records are selected when a search command is issued. A further description of this option will be dealt with in the 'Searching for Records' section of this manual. The default value of'no' is recommended until you have become more familiar with the search command. Once the 3 options have been set the ENTER key should be pressed to store the values. The screen will then clear and a cursor will be displayed below a broken cyan coloured line. Page 3 CREATING A FILE Designing a File Before sitting at your computer to create a file you should plan what results you expect to achieve and therefore what data you need to capture. This is not just a prerequisite of using DATABASE II, but a requirement of any automated filing system. Your file should be organised in such a way that you can retrieve selected records as simply as possible. If, for example, you have entered the names and addresses of your family and friends you may like to enquire who lives in a particular town so that you can visit those people when making a trip. As you will learn later on in the manual DATABASE II has a search facility to locate records of your choice. If you have not been consistent in the method of entering the names of towns you may have input some in full and some as abbreviations. This would obviously not produce the expected results. It is therefore necessary to standardise your data fields as far as possible. Once you start to use DATABASE II you will probably want to expand your use of it. Considering you have already input the names and addresses of your faimily and friends it seems a naturaly extension to add their telephone numbers and birth dates. You will then be able to use this file to replace your manual records. It would be a simple matter to list all people with birthdays in March or search for the telephone numbers of all friends in Surrey. DATABASE II allows you to define up to 20 fields per record, each having up to 50 characters. It is, however, necessary to define all fields when creating the file. As already stated, you must spend time to design your file. Ensure you have included all the fields you are liable to require for current and future needs. Creating your File Provided you have just loaded DATABASE II and no other file exists in your spectrum you should just type the following command to create a new file :- CREATE "filename" The filename can be any choice up to 10 characters. If you have already loaded or created a file the following message will appear :- File already present : PRESS ANY KEY Page 4 CREATING A FILE If your command is accepted you will be prompted to enter the name of your first data field. You may select any name of up to 10 characters which will identify this field. It is suggested you choose a name which reflects the contents of the field - ie NAME, TELE, PART No. etc. As you can see, spaces and punctuation are both allowed. After you have typed the field name you should press . Up to 20 field names may be created per file. Once the last name has been input you should press the key twice. DATABASE II has now created your file in the format you have requested. The next stage will be to enter data into the new file. Page 5 ENTERING RECORDS Having just created a new file your screen will be blank with the exception of the broken cyan line and a cursor. You can initiate data entry by typing :- INSERT n Where "n" is the number of records to be entered at one session. There is very little advantage by choosing a high value for "n". As already stated, the last command can always be repeated by pressing the key. If you have 8 records to enter you could therefore set "n" to 2 and recall the last command 4 times. After typing the INSERT command you will be presented with a blank record indicating the filename and field names. You may now enter up to 50 characters of data into each field and press the key between fields. A status line at the bottom of the screen will keep a running total of the number of records entered and the number remaining in the current insert command. Once the last record has been entered you will be presented with a copy of the current record on the screen. The current record is not the last one entered, it is the one displayed on the screen. The process to change this record will be described later in the manual. By default the current record will be the first one input. Page 6 SAVING & LOADING FILES Saving a File In the previous sections of this manual you have learned how to create a file and enter data. This information is held within the Spectrum's RAM for fast access. If the computer is switched off at this point all the data would be lost. It is therefore necessary to store the file on cassette for future use. The command to save a file is :- SAVE "filename",n Where "n" is a number from 0-9 This number indicates the speed of saving. Speed 0 is slower than the normal Spectrum save command. This is used for cassette recorders which have proved unreliable at normal speed. Speeds 1 - 9 offer progressively faster speeds up to a maximum of 2.5 times the normal speed. DATABASE II will prompt you to load a cassette etc. after you have entered the command. It is suggested you experiment with the various speeds to find the optimum value for your particular cassette recorder. Loading a File When you first load DATABASE II only the program will be loaded. It is expected that your individual files will be save to separate cassettes for ease of use. To load a chosen file just type the following command :- LOAD The filename or speed parameters are not required for the load command. DATABASE II will load the first valid file it reads on the cassette and automatically sense what speed it was saved with. NOTE There is a file called "Europe" recorded after the DATABASE II program on both sides of the cassette. This is sample file which can be used to experiment with. You may find it useful to load this file when practicing the various commands described in the next few sections of the manual. Page 7 SEARCHING FOR RECORDS Once you have created or loaded a file you will be presented with a view of record number 1 on your screen. One of the main benefits from using an automated filing system such as DATABASE II is the ability to quickly display records of your choice. This program offers 2 methods of record selection. Manual Method Several commands are available to you for moving through the current file to display records :- FIRST This command will display the first record of the file LAST This command will display the last record of the file NEXT This command will display the next available record to the screen. This command is useful if you need to page through your file sequentially. As already stated the last command typed is available on the key. Once you have typed the "NEXT" command, pressing will repeat the process automatically. BACK This command has the opposite effect to the "NEXT" command. It will display the previous record each time it is called. REC n This command will display the record indicated by the number "n" Automatic Method The automatic search facility of DATABASE II provides a quick method of locating specific records or groups of records in your file. There are 2 variations which can be used :- 1) FIND "string",n The "FIND" command will display each record which contains the characters "string", starting from record number "n". You will be prompted for continuation at each successful find. Page 8 SEARCHING FOR RECORDS 2) SEARCH "field","string",n The "SEARCH" command provides a more specific form of locating records. It will locate each record which contains the characters "string" in the field "field" starting from record number "n". NOTE a) The characters used for "string" can be any upper or lower case characters. The way in which DATABASE II deals with different case characters depends on your reply during the "DATABASE II CUSTOMISER" option - "case discrimination". If you ansered "no" the 2 search commands will ignore which case the "string" characters are supplied. If you answered "yes" an exact match must be found including upper and lower case characters. b) The "field" name of the "SEARCH" command may be in either case. Page 9 AMENDING & DELETING RECORDS Before any records can be amended or deleted they should be made the current record. The current record is the one which is shown on your screen. The previous section of this manual explained how to perform the various search facilities to locate records. Use these instructions to select the required records for the following commands. Amending a Record To amend the current record just type the following command :- CHANGE A blank record will be displayed with the previous contents of each field shown at the bottom of the screen in turn. You should retype each field in turn until you have completed the last field. Deleting a Record To delete the current record just type the following command :- WIPE You will be asked to verify whether you really want to delete the record before continuing. Deleting a File from Memory To delete an entire file from your Spectrum's RAM you should enter the following command :- ZAP You will, once again, be asked to verify your intentions before continuing. You may need to call this command before using the "CREATE" option to set up a new file. Page 10 SORTING RECORDS When you view records using the "NEXT" and "BACK" commands they are displayed in the order you inserted them. To group certain records together for displaying or printing DATABASE II has a sort facility. This enables the current file to be rearranged into an order specified by you. To invoke a sort you type the following command :- SORT "field",O Where "O" is the sort order - either Ascending or Descending NOTE a) Spaces are ignored and blank records are sorted to the end of the file. b) Numbers are treated as their ASCII code. This places them before any alpha characters. All fields within a DATABASE II file are stored as alpha characters. If you try to perform a specific numeric sort the results will be unpredictable. Page 11 PRINTING RECORDS Provided your Spectrum is fitted with a Sinclair Interface 1 unit and serial printer will be able to take advantage of the DATABASE II print facilities. Before any printing can take place you will need to tell DATABASE II the speed of your printer's interface. This will be listed in the printer manual and will be stated as a "baud rate". To set the print routine correctly type the following command :- BAUD The following screen will be displayed :- ENTER THE BAUD RATE OF YOUR PRINTER 50 110 300 600 1200 2400 4800 9600 19200 Cursor moves, ENTER selects, SPACE aborts Use the up & down cursor control to highlight the required speed and press to set the baud rate. This speed will remain set until you reset you Spectrum. If you intend to use DATABASE II for printing you could call the "BAUD" command when you first load the program. Page 12 PRINTING RECORDS Now the baud rate has been set you may select which records are to be printed. This is achieved by typing :- PRINT The first question to be asked will be :- Print field names ? (Y/N) If you reply "Y" each field of the printed record will be preceded by its field name. In most cases you will reply with a "N" to suppress the field names. You need only press the "Y" or "N" key to reply - the key is not required. The next question to be asked will be :- Enter first record number You should reply with a valid record number followed by . The final question to be asked will be :- Enter last record number You should reply with the last record number to be printed. If this number is lower than the first number you will be prompted to re-enter both numbers. If both numbers are accepted the specified records will be printed. NOTE a) If, after initiating a print, you decide to stop it - DO NOT PRESS BREAK. Just press any key once and wait for your printer's buffer to empty. b) If during a print DATABASE II encounters a problem the program may drop into BASIC. It can be restarted by typing the following BASIC commands :- CLOSE #3 RANDOMIZE USR 58921 Page 13 PRINTING RECORDS c) The first and last record numbers may be the same if only 1 record is to be printed. d) To enable various records to be grouped together for printing as a range, they should be designed with a field which they can be sorted upon. After performing a sort on this field you could then identify the required range using the "SEARCH" command. e) If, for example, you need to print name & address labels you could create your file with enough fields to space the labels apart exactly for line up. If this required more fields than was actually needed you could just ignore the additional fields when inserting data. Page 14 USING THE SCREEN EDITOR When you create a file and insert records the ink & paper colours default to yellow on black. To create a more interesting display DATABASE II has a Screen Editor which allows the full range of Spectrum colours and attributes to be allocated to any standard character square. It must be stressed the commands within this editor have no effect upon the actual data in your file. You can not modify or erase your records by using the Screen Editor. The results of the editor can be looked upon as a separate file of colours which sits in front of your records when viewed on the screen. At any point after creating a file you can activate the Screen Editor by typing :- SCREEN A prompt line at the bottom of the screen will supply you with 4 possible options :- (1) Create This option will destroy any previously designed screen information and pass control to the Screen Editor. (2) Modify This option will pass control to the Screen Editor for you to amend the current screen design. If no current screen information exists this option will be ignored by DATABASE II. (3) Exit This option will save any changes you may have made and return you to the normal command mode. (4) Clear This option will destroy any existing screen information without passing control to the Screen Editor. When options 1 or 2 are selected a new prompt line will be shown :- Cursors move, ss+f=flash, ss+b=bright, ss+0-7=paper, 0-7=ink The flashing cursor can be moved to any part of the screen by use of the cursor keys. When the cursor is placed on the first position for editing you can choose 1 of the 4 options to add colour and attributes. The codes 0-7 follow the normal Spectrum colours as described in the Spectrum manual. If, for example, you want that particular square to have red ink on white paper you should press the "2" key to set the ink colour. You should then hold down the Symbol Shift key and press "7" to set the paper colour. The cursor could then be moved to the next square for similar treatment. Page 15 USING THE SCREEN EDITOR Once you have moved over your screen and added colour you may want to use the "bright" and "flash" attributes. These can be applied in a similar way to adding colours. Just move the cursor to the relevent square and hold down the Symbol Shift key and press "f" to make the square flash. Symbol Shift and "b" will make the appropriate square bright. The bright and flash attributes can be switched off by repeating the same procedure once more on the necessary squares. When you have finished designing your screen press the key to return to the "SCREEN" prompt. If you are happy with your artistic work you should select option "3" to exit to command mode. If futher editing is required you can re-enter the Screen Editor by choosing option "2". When you are completely satisfied you should re-save your file in the normal manner. This will automatically save the screen design with your data. Suggestions At first you may think the Screen Editor is limited in use. With careful selection of ink & paper colours it is possible to enhance the image of your records and add emphasis to particular fields. If you know the maximum size of the record's fields you could "paint" a white border of paper colour around the perimeter of the record. You could even create dummy fields and set the paper & ink colours the same. This would have the effect of separating adjacent fields from one and another, thus creating a clearer display. When you insert records the screen colours are temporarily removed to allow all fields to be viewed. This means that you could set the paper & ink colours the same for the field names. This would make them invisible when displaying records, yet available for further inserts. If you set the paper & ink colours the same and hide art of your record there is a command available to temporarily remove the colours and attributes. This should be typed from the command mode as follows SCR This will remove the screen design and reveal the current record as it was originally created. Entering this command a further time will reapply the design. Page 16 MISCELLANEOUS COMMANDS There are 3 further commands available when using DATABASE II. Each command is input from the command mode and followed by the key :- STATUS This command reports the amount of memory available for storage, the number of fields in the current file and the number of records in the current file. TEXTINK n This command changes the colour of the text on the screen. The value of "n" follows the normal Spectrum's colour codes between 1 & 7. This command is overridden by the Screen Editor. If a screen design has been created the "TEXTINK" colour will only take effect if "SCR" is performed. INK n This command will change the colour of the Edit Line characters. Values for "n" may be in the range 1 to 7. Page 17 GLOSSARY OF TERMS The following terms are used throughout this manual and are explained here for clarification. The definitions provided are specificly related to the DATABASE II product, although some may have other meanings. ASCII American Standard Code for Information Interchange - Each character stored in the Spectrum is represented as a numeric code (0-255). Attribute The status of a particular character square on the Spectrum's display. Appart from the various colours, the square could be flashing, steady, bright or normal. Baud A measurement of data transfer speed. This speed is approx equivalent to 1 bit per second. Bit Binary digiT - a value of either 0 or 1. A group of 8 bits represent one character. Byte The amount of store occupied by one character. A group of 8 bits represents 1 byte. Data The collective name for the information you enter into the computer. Database A collection of data which can be easily viewed and manipulated. Field A specific area within a record containing a predefined section a data. File A group of records. Ink The name given to the text colour on the Spectrum's display. Paper Tne name given to the background colour of the Spectrum's display. RAM Random Access Memory - The store inside the Spectrum where programs and data are held. Record A collection a fields which together form a complete set of information. Page 18 COPYRIGHT (c) Foraits Software - 1987 Written by Andrew Brown This software and documentation may not be copied, hired, lent or re-sold without the written consent of Foraits Software. Foraits Software 32, Gladstone Road Hockley Essex SS5 4BT Tel : (0702) 201368