This document describes all the features accessible from the Powerbase
keypad together with other facilities associated with the editing of
records. Databases which suppress the keypad and place controls on the
record window may not include all the facilities described. Keystroke
equivalents exist for many of the mouse operations and these are given in
parentheses at the appropriate points.
Subfiles
========
The concept of subfiles needs explaining before proceeding further. A
Powerbase database comprises six subfiles which are numbered 0-5. When a
database is opened the “active” subfile is always 0, as shown in the title
bar of the record window, and new records will be added to subfile 0. You
may ignore the other five if you wish. They occupy no additional room in the
database: if the length has been defined as 100 records this means a common
“pool” of 100 from which records may be all assigned to subfile 0 or
distributed between the subfiles as the user wishes. Suggestions as to when
several subfiles might be useful are given in the relevant sections below
(“Changing subfiles - Using more than one subfile”).
Appearance of record window
===========================
A newly-opened database will display the first record in subfile 0. The
title bar of the record window gives the record number and the primary key.
The primary key field is highlighted by making its background pale yellow*
instead of white like the rest and the field descriptor is red* indicating
that the primary key is the currently-selected key. It is possible that two
fields will be highlighted in this way meaning that the primary key is a
composite one made up from the characters of two fields. (See ‘Create’ for a
description of key-structure.) Most of the other descriptors will be black
but dark blue* indicates a subsidiary key which has been created by indexing
the field. (See ‘Indexing’.) There may also be fields whose bounding boxes
and text are dark green* indicating that a field is linked to a validation
table. (See ‘Validation’.)
*These are the default colours. They may have been changed
via the ‘Colours’ entry on the ‘Miscellaneous’ submenu.
Moving about the database
=========================
Six buttons on the top row of the keypad cause movement within the subfile.
From left to right their actions when clicked on with SELECT are:-
1) First record (keystroke equivalent f3)
2) One record back (SH/f2)
3) 10 records back (SH/f7)*
4) 10 records forward (f7)*
5) One record forward (f2)
6) Last record (SH/f3)
*The “fast forward/rewind” interval may be altered by typing
in the writable icon between these two buttons.
The file wraps around so that one forward from the last record takes you to
the first and one back from the first record takes you to the last. In
accordance with RISC OS conventions clicking with ADJUST instead of SELECT
reverses these actions so that ADJUST over the first button, for instance,
takes you to the last record rather than the first. This allows you to move
about the database with fewer movements of the mouse. (Compare with the
standard behaviour of scroll bars and scroll arrows.)
The first button on the second row of the keypad (“Play”) starts an
automatic flip-through of the records and the last button on the row
(“Stop”) halts the process. If started with SELECT the records are displayed
in forward order. ADJUST displays them in reverse order and you may swap the
order at any time by a further click on “Play”. The time for which each
record remains on screen may be altered by changing the “fast forward”
interval (see above).
Changing keys
=============
Two “key” buttons in the middle of the second row of the keypad enable you
to cycle through the available keys in opposite directions (SH/f9 and f9
respectively). ADJUST reverses the action of SELECT. If no subsidiary keys
have been defined these buttons have no effect. Otherwise you will see the
red highlighting of the key-field descriptor move from one field to another
as the key changes. The displayed record is always the first as defined by
the ordering of the new key.
Changing subfiles
=================
A group of three buttons in the middle of the third row has the following
effects when clicked with SELECT:-
1) Back one subfile (SH/f4)
2) Rotate subfiles (CT/f4)
3) Forward one subfile (f4)
1) and 3) change the current subfile to the previous one in sequence and the
next in sequence. As with the corresponding buttons for moving from record
to record “Forward” from subfile 5 takes you to subfile 0 and “Back” from 0
takes you to 5. ADJUST reverses these actions. “Rotate” renumbers the
subfiles so that subfile 1 is the old subfile 0 etc. The old subfile 5
becomes the new subfile 0. Records which were previously in, say, subfile 2
will then be found in 3 instead. Since this is quite a drastic change you
will be asked to confirm that it really is what you want before Powerbase
proceeds.
Using more than one subfile
—————————————-
A Powerbase database consists, as stated earlier, of six subfiles numbered
0-5. You may use subfile 0 (which is used by default) and ignore the others
if you wish, but there are occasions when users may find subfiles very
useful. If, for example, you are maintaining a set of pupil records in a
school you could assign one subfile to each year. At the end of a school
year the promotion of Year 1 pupils to Year 2, Year 2 to Year 3 etc can be
brought about by a single click on the “Rotate” button.
A more common use of subfiles is to use 0 to hold the main set of records
and 1 as a dumping ground for records which you want out of the way but
don’t want to get rid of permanently. Powerbase is actually used in this
way in a Further Education college where the applications file for a course
is built up in subfile 0. When students enrol on the course their records
are updated to reflect this and records for those who have not appeared are
moved into subfile 1. The enrolled students in 0 are then timetabled and
class lists are printed. During the first week of the course there is a
trickle of late enrolments which simply involve retrieving the required
records from subfile 1 and reinstating them in 0.
The facilities for moving records, singly or in batches, from one subfile to
another are described below. (“Deleting records”)
Searching for a record
======================
Searching by key
————————
The icon bearing a record card and a question mark is the “Search” button.
When clicked with SELECT (keystroke equivalent f1) the keypad expands to
reveal a new section on the right. Type the key of the record to search for
into the writable icon and either click on ‘OK’ or type RETURN. (‘Current
key‘ on the main menu gives access to a dialogue box describing how the key
is constructed.) If the key exists in the current index the record will be
found and displayed. If the key doesn’t exist Powerbase bleeps and displays
the nearest matching record with the key field flashing. If the database is
a small one with keys which differ greatly from record to record then the
displayed record may not look to be very near at all. The keypad will return
to its normal appearance if you typed RETURN or used SELECT on the ‘OK’
button. If you want to use the “Search” function repeatedly it is more
convenient to have the keypad remain in its expanded state and this can be
achieved by clicking on ‘OK’ with ADJUST. If you do this you will notice
that the icon to the left of the ‘OK’ button displays the number of matches
found.
The index being searched is displayed on the expanded keypad. Provided the
database uses at least one subsidiary key you will see it change as you
click on either of the “Change key” buttons.
As described above the “Search” function searches only the current subfile.
If you suspect that the record you require might be lurking in some other
subfile you can force all six to be searched. This can be achieved by using
ADJUST (keystroke equivalent SH/f1) instead of SELECT on the “Search” button
or, after the keypad has expanded, by changing the selected radio button
from the first to the second. If the record is found in some other subfile
then that subfile will be made the current one and the record displayed.
If searching on a numeric key you will only find the record by entering a
number of exactly the right value. If the key is alphabetic, however, you
may use just the first few letters if they are sufficient to distinguish the
key from others.
Searching by record number
—————————————
You may type a record number, preceded by #, (e.g. #1054) instead of a key.
Provided the record is in use Powerbase will find and display it, regardless
of what subfile it is in. If the record has been deleted or has never been
assigned a “Record not in use” error is generated.
Searching by filter
—————————-
In the middle of the last row on the keypad is the “Filter” button. When
clicked the keypad expands downwards revealing a writable icon into which
you can type a Search Formula followed by clicking on ‘OK’ or typing RETURN.
(See ‘Printing’ for an explanation of search formulae.) The keypad buttons
used for browsing will now only display records which match the search
formula, all non-matching records being “filtered out”. The match is case
specific by default but may be made non-specific by de-selecting the option
switch on the keypad extension.
Deselecting the “Filter” switch restores the keypad to its normal appearance
and operation.
Editing the database
====================
Adding new records
—————————
The icon bearing a record card and a plus sign is the “Add record” button
(keystroke equivalent f10). Clicking with SELECT displays a blank record for
you to fill in and the window title says “New record”. The only field which
you MUST fill in is the primary key field. Any or all of the rest of the
fields (including subsidiary key fields) may be left blank. You may find on
some fields that the keys you press will have no effect. This will happen,
for example, if you try to type letters into a field which has been defined
as numeric.
If you type into a field which is highlighted in dark green you may get an
error message. Such fields will only accept certain “values” which are
listed in a Validation Table (see ‘Validation’). To see what these allowed
values are make sure the caret is in the relevant field then click on the
“List values” button on the keypad (keystroke equivalent f8). If the table
validation feature proves to be a nuisance you can turn it on and off with
the ‘Validate input’ entry on the ‘Validation’ submenu. If the entry is
ticked then validation is “on” (keystroke equivalent SH/f8).
When you have entered as much of a record as you want to you can click “Add
record“ again for another blank record. The record which you have just
entered is automatically written to the file. The same is true if you click
any of the other keypad buttons or close the database altogether - you never
need to do anything to “tell” Powerbase to update the file. There is indeed
a button called “Force update” but you don’t really need to use it. It is
provided so that, during a long working session, you can force Powerbase to
save to disc certain items (indices and validation tables) which are kept in
memory while Powerbase is running. This is to guard against a power cut or
system failure (such as some kind person switching your computer off for you
when you’ve just popped out for a minute!).
Using a template
————————
Sometimes you want certain fields to be filled in with a fixed value on
every new record. To save you typing the same thing into the same field
every time, Powerbase provides an “Edit template” function which is
accessible from the ‘Miscellaneous’ submenu. When you choose this you are
presented with a blank record and the window title says “Enter data which
you wish to appear by default on new records“. Type in the required ”fixed“
data then click any of the usual keypad buttons. You will now find that the
“blank” record displayed ever time you click “Add record” (f10) isn’t really
blank at all but already contains the data entered in your template. Note
that this feature affects NEW records only. It doesn’t have a retrospective
effect on existing records.
Using the clipboard
—————————-
The buttons at the far left and right of the middle row of the keypad may be
thought of as “Icon to clipboard” and “Clipboard to icon” respectively. They
can save considerable time when you want to copy data from one field into
another, whether in the same record or in a different one. When you click
SELECT on “Icon to clipboard” the contents of the field which has the caret
are stored in memory. Positioning the caret in another field and clicking on
“Clipboard to icon” will copy the stored data into the new field. If the
data is too long for the field it will be truncated to fit. Once you have
data on the clipboard you may copy it into other fields as many times as you
wish - the clipboard contents only change when you click on “Icon to
clipboard“ again.
Choosing where the caret starts
————————————————
When an existing or blank record is displayed Powerbase places the caret in
the first editable field of the record. (This, incidentally, means the
lowest-numbered field which may not necessarily LOOK like the first if the
fields have been placed in strange positions in the window.)
If you are going through the database making changes to one or two fields
somewhere in the middle of the record it may be convenient to have the caret
start somewhere else. Click MENU over the field where you wish the caret to
start, go to the ‘Field’ sub-menu and choose ‘Start editing’. Whenever a
record is displayed the caret will now be placed in the chosen field. The
same procedure is used to restore the normal starting position.
Altering existing records
————————————-
A displayed record may be altered manually without any restrictions other
than those applying to the addition of new records (see above). You will be
asked to confirm an alteration which would result in a change to the primary
key. The normal RISC OS conventions for editing writable icons apply, e.g.
CTRL-U to clear the icon. As with new record entry you need do nothing to
make Powerbase record your changes to disc - the process takes place when a
different record is displayed, when a database is closed or when you quit
Powerbase.
Can I “undo” if I make a mistake?
————————————————-
Yes, provided that you haven’t clicked on ‘Force update’ (a thing you should
not normally need to do anyway) or done anything which causes Powerbase to
display a different record. In other words you can undo changes made to the
current record as long as it remains on the screen.
Bring up the main menu and choose ‘Undo changes’. The displayed record will
be returned to the state it was in when you displayed it and before you
began to edit it. To restore single fields, click MENU over the required
field, go to the ‘Field’ sub-menu and choose ‘Undo changes’.
Note that only ordinary writable fields and check boxes may be restored; you
can’t restore external fields (see below) which is why a warning is normally
issued before deleting such fields.
Making the same change to many records
———————————————————
To alter a given field in a set of records you must first point the mouse at
the field and click MENU. This gives access to the ‘Field’ submenu on which
the second item is ‘Global changes’. In the first writable icon enter
whatever you want the field changing to. In the second enter a Search
Formula specifying which records are to be changed. (See ‘Printing’ and also
“Searching by filter”, above.) When you click on ‘OK’ or type RETURN all
matching records in the current subfile will be altered in the way you have
specified, provided that the new data will fit. If no search formula is
entered then ALL records in the subfile will be changed. If no new data is
typed into the first writable icon then the field in the matching records
will be BLANKED.
You may also use ‘Global changes’ to perform a simple calculation e.g. “+12” will cause 12 to be added to the current value in the field on
all the matching records. “*5-13” will cause current the value to be
multiplied by 5 and then decreased by 13. It is operations like these which
are most likely to produce values which won’t fit in the field, especially
if floating-point numbers are involved. The operation isn’t limited to Numeric fields, or even to other types of field consisting wholly of numerals: ‘Powerbase’ will find the number embedded in an entry such as “ABC45XYZ” and the operation “+12” would convert it to “ABX57XYZ”.
Deleting records
————————
Only three keypad buttons still need explaining; the large one bearing the
dustbin icon and the ones on either side of it:
1) Shift record back (SH/f6) Moves record into previous subfile.
2) Delete record (CT/f6) Removes record permanently.
3) Shift record forward (f6) Moves record to next subfile.
The action of 2) is obviously more drastic than those of the others and you
will be asked to confirm your choice before the record is actually deleted.
The others “delete” records from the current subfile but do so without any
fuss or bother because you can always get them back again. It is sometimes
useful, especially when reinstating a record, to be able to “follow” it into
its new subfile. You can do so by holding down SHIFT while you click on the
keypad button.
Deleting many records at once
——————————————-
Powerbase provides a ‘Batch delete’ choice on the ‘Miscellaneous’ submenu.
It leads to a dialogue box which displays the same three icons as those on
the three keypad buttons just described. Here, however, they are merely for
identification. The radio buttons beneath them determine what will happen to
the records and the default setting is for “Shift forward”. Type a Search
Formula (see ‘Printing’ and also “Searching by filter”, above) and click
‘OK’ or type RETURN. All matching records in the current subfile will be
moved or deleted as specified.
External fields
===============
External fields are described in some detail in connection with creating a
new database (see ‘Create’). They involve Text, Sprite or Draw files (one
file for each record) which are stored within the database application
directory and are either linked to buttons on the record screen or are
actually displayed in large icons on the record screen. (The latter type
cannot be used for Draw files.) They provide a means of associating record
fields with pictures and with blocks of text which are too big to fit a
normal text field.
You can’t edit an External field directly, even when it contains text as
opposed to graphics. When you move the pointer over such a field it changes
to two linked squares indicating that the data associated with the field is
linked to it but not actually “in” it in the sense that data in ordinary
editable fields is.
To link a file with such a field all you need do is drag the file’s icon
onto the record window and drop it on the appropriate field. If, for
example, the record includes a field represented by a “Text” button, i.e.
one bearing a small version of the Edit icon, you may drop a Text file onto
it. The button’s icon changes to the small version of the Text file icon to
indicate that the file has been linked. As long as the filer has “seen” the
Edit application (or some other RISC OS text editor) clicking on the button
with SELECT will load the file into the editor and display it. You may then
edit the file and re-save it without altering its name and it will still be
associated with the same field of the same record. Sprite and Draw files may
be dropped onto the appropriate type of button in exactly the same way and
may be displayed and edited with Paint and Draw respectively.
A field of ‘Text Block’ type may also have a Text file dropped onto it. This
time the text (or as much of it as will fit inside the icon’s bounding box)
is actually displayed on the record window. You can’t edit the text directly
(clicking with SELECT over it has no effect) but it is possible to export
the file for editing (see below). Sprite files may be dropped onto and
displayed in a field of ‘Picture’ type.
Any new file dropped onto an external field which is already linked to a
file simply replaces the old file with the new.
NOTE If you drop a text file in the wrong place in the record window
Powerbase will think you want to treat the file as like CSV file and import
data from it (see ‘CSV files’) and the ‘Import text file’ window will
appear. This is somewhat startling but harmless enough as long as you don’t
click on ‘GO’ or type RETURN! Click on ‘Cancel’ to get rid of the window.
Editing external fields
———————————-
Clicking MENU over an external field makes available certain entries on the
‘Field’ submenu which are shaded for other types of field. ‘Clear contents’
enables you to delete the linked file from the database application. Since
deleting a whole file is rather drastic you would probably like to be warned
when this is about to happen. The message “Delete object? Are you sure?”
normally appears, but you can disable it by clicking ‘Warn of delete’ on the
‘Field’ submenu so that the entry becomes unticked. Finally, ‘Save contents’
on the ‘Field’ submenu permits you to export the linked field to a filer
window or directly into Edit, Paint or Draw.
In the case of ‘Text’ and ‘Text Block’ fields a more convenient means of
exporting the file is to select the field as if for printing then type
SHIFT/f5. The ‘Save’ box containing the default filename will then appear.
This works only when nothing else but the required field is selected. It
can’t be used with ‘Picture’, ‘Sprite’ or ‘Draw’ fields because these can
never form part of a print selection and cannot therefore be selected with