Tutorials for Powerbase

© Derek Haslam
Fully revised Jan.2011 to comply with Powerbase v.9.75 (10-01-2011)

Home   Main Tutorial   Reference Manual

Quick Tutorial

This tutorial is intended to acquaint the new user as painlessly as possible with the most commonly-used facilities of Powerbase. It does not explain how to create a database from scratch (for this see Ch.4 of the Reference Manual; there is also a simple example in the Main Tutorial), nor does it delve into the many advanced features, but it does explain how to:

The supplied sample database Friends is used to illustrate most of these activities and you should copy it, and Powerbase itself, onto your hard disc before proceeding further. Powerbase can provide context-sensitive help on its windows and menus via Acorn's interactive Help application and you are advised to make use of this. The ultimate source of help is, of course, the Reference Manual which can be invoked from the PbaseDoc button on the Information window accessed from Powerbase's iconbar menu.

1 Starting Powerbase

Double-click on the Powerbase icon. After a few seconds it will appear on the iconbar with the words "No data" beneath it to show that no database is open. Double-clicking the Friends database will open it for use and the words "No data" will be replaced by the name of the database.

When the database opens the record window appears with the first record in the database (the one for Badgery, Peter) displayed. Attached to the left-hand edge of the record window is the tool-pane (see below) which enables you to control the browsing, searching and editing functions of Powerbase. Descriptions of some of the tool-pane buttons referred to in the tutorial can be accessed rapidly by clicking the mouse over the relevant part of the illustration. A "thumbnail" representation of the tool-pane appears in several places in the right margin and may be clicked to take you back to the tool-pane illustration. top of page

tool pane

2 Browsing and Searching

Now that you have a database running you will learn first how to move from record to record and how to access any specific record by using a small group of letters called the key of the record. The mouse clicks referred to (other than those for displaying menus) are normally made with the SELECT (left) button. If the chosen tool-pane action has an obvious opposite then you will find that using the ADJUST (right) mouse button brings about that effect. For example, while SELECT on the single step button takes you one record forward in the database, ADJUST on the same button takes you one record back.

2.1 Browsing through the Records
The buttons at the top of the tool-pane allow you to browse through the database. If you have Help running, as previously suggested, it will tell you what each button does. Once you get the general idea you will find the symbols on the buttons logical and self-explanatory. The most often used ones act as follows:

(a) The ends button takes you to the last record in the database when clicked with SELECT and to the first record when clicked with ADJUST. You are looking at the first record now, so click with SELECT and you will see the record for Turnip, Charles. ADJUST takes you back to Badgery, Peter again.

(b) Movement through the database one record at a time is achieved using the single step button Try it out, again using SELECT and ADJUST, noting the way records come up in alphabetical, or reverse alphabetical, order.

(c) The fast-forward/rewind button lets you make longer jumps through a database. The number of records skipped is shown in the writable icon called fast-forward interval and has a default value of 10. As there are only 10 records in Friends these keys will have the same effect as the ends button, unless you make the interval smaller. Click in the writable icon, delete the 10 and enter 5 or 2, then try fast-forward again.top of page

2.2 Searching for a record
Now try clicking the search for record button with SELECT. A small window opens to the right of the tool-pane.

search

This is the Search window and contains a writable icon in which to enter the key of the record you wish to display. In this database keys are made up from the first 4 letters of the surname plus the initial of the first name so, if you wanted to call up the record for Bloggs Fred you would enter BLOGF. Do so, then click on Find (or type the Return key on the keyboard) and the record will be displayed. Note that the key is shown in the heading of the record window.

If you enter a non-existent key Powerbase briefly displays a small grey window informing you of this, then displays the record which most nearly matches the key. The displayed record might not look like the nearest match, especially in a small database like this. e.g. If you thought there was a record for Bodmin George and therefore entered the key BODMG the displayed record would be that of Bloggs Fred (key BLOGF). Step forward one record and you will find Cavendish Edward (CAVEE) which would come after Bodmin if the latter were present. You could try entering Bodmin's record with the desired key to verify that this is indeed so.

Although the above examples show the entered keys in uppercase letters this is by no means obligatory; you can create databases in which keys are case-sensitive but Friends isn't one of them and any combination of upper and lowercase may be used.

tools/png

3 Editing the Database

3.1 Modifying records
Point at any field and click SELECT. The red text caret will appear in the field. The contents of the field may now be edited with the aid of the keystrokes which are standard for all RISC OS writable icons: Having modified one or more fields you may be wondering what you have to do to make Powerbase save the modified record so that the changes won't be lost. You don't need to do anything! Powerbase will ensure that your changes are saved when you display a different record or close the database.top of page

3.2 Recovering data after a mistake
To Main Tutorial
You may edit the wrong field by mistake and want to restore the previous contents. Call up Bloggs Fred's record and change the address from 12 Woodland Road Exeter to 12 Woodville Road Exmouth. Now click MENU over the first line of the address. The second entry on the main menu (Field) contains a short group of characters called the tag of the field, in this case ADD1. Slide off the menu to the right, which opens the Field sub-menu, and choose the next to last entry, Undo changes. The contents of the field will revert to "12 Woodland Road". Notice that only the first line of the address is affected; the town is still "Exmouth". If you want to restore that field as well click MENU over it and follow the procedure just described.

There might be occasions when you make a hopeless mess of a record and want to discard all the changes and revert to what you started with. You could, of course, "undo" each field separately as we just did for the street address and town but there's a quicker way. Look at the bottom of the main menu and you will see that here too is an Undo changes option. Choosing this undoes all the alterations you have made.

It is important to realise that these facilities depend on the fact that Powerbase holds the currently-displayed record in memory but no other records and will therefore only work if the altered record has remained on display from the time you started changing it up to the point where you decided to "undo". If you have looked at another record or clicked on Update in the meantime then the changes will have been written to the disc and thus become "permanent".top of page

3.3 Adding and deleting records
To add a new record we use the add record button. Clicking on this offers a blank record into which you can type new data. You need not complete all the fields, in fact the only field into which you must type something is the NAME field. This is the key field; the one from which the key, mentioned earlier, is derived. If you leave this field blank then no new record is created; if you have filled in other fields and simply overlooked the key field a warning message is displayed and you will be given the opportunity to complete the record by filling in the key field.

Type the name Bodmin George, then go to the beginning of the database and step through it record by record. You will find that your new record has been inserted in the correct place, i.e. the sequence goes: Badgery, Bloggs, Bodmin, Cavendish.

Now try deleting the record you've just added. The delete button (the one with the dustbin icon) will do exactly that, but don't use it just yet. Make sure that the unwanted record is on the screen and click the button above the "dustbin" button instead. You will now find that Bodmin's record has vanished; the names run straight from Bloggs to Cavendish, just as they did before you added Bodmin.

This looks a bit too easy. Suppose you clicked the button by mistake and deleted an important record? No problem; what you have just done has been made easy because the action is far less drastic than it looks. The record hasn't really been deleted at all. Click the change subfile button and "Bodmin" will reappear. You will soon find, however, that it appears to be the only record in the database! Don't worry; nothing has been lost. A Powerbase database is treated as sixteen separate subfiles numbered 0-15. When you first open the database you are looking at Subfile 0 and the heading of the record window shows this. If you look at the heading now you will see that it has changed to Subfile 1.tools/png

The button above delete does not delete records; it merely moves records from one subfile to another, as its label implies. A click with SELECT moves the displayed record to the next subfile in sequence. Thus, in the above case the "Bodmin" record has been moved from subfile 0 to subfile 1. A record in subfile 1 would be moved to subfile 2 and so on. When it gets to 15 the next click moves it into subfile 0 where it was originally. As you may have guessed, using ADJUST instead of SELECT moves records in the opposite direction, i.e. from subfile 1 to 0 or from subfile 0 to 15.

If you do want to lose a record for good you consign it to the dustbin by clicking on delete. As this button's action is more drastic than that of the other you are given a chance to change your mind. A window headed Powerbase: please confirm: will appear displaying the question Delete record permanently? A positive response causes the record to be deleted, Cancel removes the warning window from the screen leaving the record untouched.

You might prefer to have a warning message and a request for confirmation when simply moving a record to the next or previous subfile (especially if you sometimes click the move record button by accident). You can enable confirmation by editing the ShiftWarn option in the !Powerbase.Resources.Config file as described in the Main Manual Ch.14.8.

4 Creating Lists (Reports)

Before Powerbase can produce a list it must be told:

4.1 Making the field selection
Specifying the fields you want is easy. To include a field point at it and click with ADJUST. The selected field will then appear with its foreground and background colours reversed. If you change your mind you can de-select it by clicking on it again with ADJUST. The order in which you select the fields is the order in which they will appear in the report. Take care with this as there is nothing on the screen to indicate what order the fields will be in (but see section 4.2 below). Field selections may be saved (using Save selection from the Report submenu) and reloaded for future use. For now select the name and the first 3 fields of the address.top of page

4.2 Choosing which records to include
Specifying which records to include is somewhat more complicated. Click the Report button on the tool-pane (or type the Print key on the keyboard). A window called the Match window will open. Unless you have selected at least one field, as described in 4.1 the menu button labelled Fields selected will be shaded as illustrated. Otherwise, clicking on it will display a list of the selected fields in order of selection.

match

The caret will be in the writable icon. This is where you specify the criteria which records must meet for inclusion in the list. If you just click on the Report button on the Match window (or type Return) without entering anything, you will obtain a list of the whole database (or, more accurately, of the the whole of the current subfile). Try that first.

When the process is complete the list will be displayed in a window. If no records at all appear make sure the icon for subfile 0 is highlighted as shown. Click on it with SELECT if it isn't. If you point to a record in the list and double-click with SELECT Powerbase will display the chosen record in the main record window. Note that the caret is placed in the field you were pointing to on the list. This is very useful if you spot errors in the data whilst examining a list. A double click on the offending item offers the record with the caret correctly positioned for editing.

Most reports include only some of the records, not the whole database. To target a particular group of records we need to enter a search formula which will distinguish the records we want to include from all the rest of the records. Search formulae can be quite complex and detailed treatment will be found in the Reference Manual. Only a few simple examples are shown here. Enter the following before clicking on Report: ADD2=Exeter

The report window appears showing just one record: the one for "Bloggs Fred". ADD2 is called the tag of the field. The label which appears beside a field on the screen is called its descriptor and you might have expected such labels to be used to refer to fields in search formulae. This is not done for two reasons:tools/png

  1. Descriptors can be inconveniently long for use in this way.
  2. Fields don't necessarily have descriptors. Of the 5 address fields only the first and last have descriptors (Address and Postcode respectively). Since every data field needs a "handle" of some sort so that we can include it in a search formula we give each a tag, which is never more than 4 characters. Clicking MENU over a field makes its tag appear in the second menu item.
The record for "Bloggs Fred" is, however, not the only one with an address in Exeter. There is another ("Sunningdale Samantha") but with Exeter in ADD3 rather than ADD2. You can have both appear on the report by using the formula: ADD2,ADD3=Exeter

Notice the way the alternative tags are separated by commas. We call this a tag list. A record will be included if any one of the tags in the tag list is matched. The part of the search formula after the = sign is called the target and here too we may specify several in a target list. Try the following: ADD3=Exeter,Anytown and also: ADD2,ADD3=Exeter,Anytown

The first of these examples lists the records for "Soap Joe" and "Sunningdale Samantha", the second lists these two and "Bloggs Fred" as well. What the second formula is saying is "Include all the records which have either 'Exeter' or 'Anytown' in either the ADD2 or ADD3 field".

The characters we want to match don't, of course, always make up the entire field. You can also search for part of a field. Suppose you wanted the records for people called Peter, Fred and Jean. Enter the formula: NAME{Peter,Fred,Jean

and you will find that the records for "Badgery Peter", "Bloggs Fred" and "Ford Jean" are listed. The curly bracket ("{") means "contains". i.e. the name field doesn't have to consist wholly of Peter, or Fred or Jean, but has to contain one of these names somewhere within it.

4.3 Hard copy printing
So far you have displayed reports in a window. If you want to send them to your printer the following method might work. Run Printers, switch on the printer, then click MENU over the displayed report. The Save as text option leads to a standard Save box from which you can drag the file icon to Printers on the iconbar. With luck your printer will spring to life and print the report. You could also drag the report to a directory window to save it. Or you could simply type Return, in which case the report would be saved under a suitable default name in a directory called PrintJobs inside the Friends database directory. Every Powerbase database has a PrintJobs directory to use as a general dumping ground for reports and which needs to be cleared out periodically. Choose Show reports from the Report submenu to display it.

If your printer is one of the more recent inkjets you might not be able to print plain text files by simply dragging them to the Printers icon as described above because some such printers contain no fonts of their own. What often happens is that the printer spews out page after page, blank apart from a few characters of gobbledegook on each sheet. What's needed here is to get Powerbase talking directly to the printer. Clicking the icon to the left of the Cancel button on the Match window will open Powerbase's Report Options window, at the top of which is an area marked Destination. Select the Printer button instead of the Window button and click on Accept. Provided the printer is ready for use and Printers is running you will now find that creating a report sends output directly to the printer instead of displaying the report in a window.top of page

5 Backing up

backup You are strongly advised to back up your database whenever you make changes to it and this is made easy by the provision of a Backup button on the tool-pane. However, Powerbase needs to be told where to back up. Clicking ADJUST on the button opens a window which invites you to drop a directory on the large down-pointing arrow icon. The pathname of the directory will then be displayed in place of <no directory>. This will be your backup directory and Powerbase needs to be able to find it in future so your backup choices need to be saved somewhere. If you want to use it for backing up all databases then select the in Powerbase radio button and click Save choices. If it is the backup directory for the current database only, select in database before clicking Save choices. (Ignore the middle radio button, the wording for which might not be "for User".)

Once a backup directory has been specified the stored pathname will be loaded from the choices file when the database is opened and a click with SELECT on the Backup button will make a copy of your database. If you want automatic backups you should select the Back up on closing button before saving the pathname. Open directory is also useful for inspecting the contents of the backup directory or retrieving the backup copy if necesssary.tools/png

6 Closing down

A database may be closed down by choosing Close database from the iconbar menu. When you do so all relevant data stored in memory is saved to disc and the database is closed. You do not have to do anything to save the database file itself to disc since it has been there all along. Only the current record is in memory at any one time and this is automatically written back to disc when it has been changed in any way.

If you are going to use another database straight away just double click on it or drag it to the Powerbase icon on the iconbar. In fact you don't even need to close the previous database before doing this; Powerbase will do it for you. To terminate Powerbase itself use the Quit option on the iconbar menu.top of page

Home   Main Tutorial    Reference Manual