This chapter describes things you can do to influence the way Powerbase looks and functions.
The largest group of user-defined choices is that controlled by the Preferences window, which is opened from the iconbar menu. Several of these choices have been mentioned in previous chapters but a full description of the window is provide here for completeness.
This refers to the framed portion of the Preferences halfway down the left-hand side, and we will begin with this because the settings chosen have an important bearing on what you see on opening a database and how you move around and edit records. The five buttons in this section have an instant effect so you can readily see what they do. If the tool-pane/keypad has been disabled from the Passwords window (see 11.2) then all five buttons are shaded.
The keypad has button-pairs for several functions which, on the tool-pane, are served by single buttons clicked with SELECT and ADJUST, e.g. there is both a "next record" and "previous record" button instead of the dual-function Single step button on the tool-pane. Even so, clicking ADJUST on the paired buttons still reverses the action of SELECT.
The most frequently used buttons on the keypad are those on the top two rows, and clicking the toggle-size icon (top right corner) reduces the keypad to these rows only. Note that there is a close icon (top left). If you do close the keypad it can be re-opened with Show keypad on the main menu (or with the Tab key).
By default Date fields have the format dd-mm-yy or dd-mm-yyyy, i.e. they use a hyphen as a separator. Time fields have the form hh:mm:ss, i.e the separator is a colon. These defaults may be changed by entering your preferred separators in the two writable icons in the Separators section at the top of the Preferences window and clicking Accept. Note that when entering dates or times into these field types you may actually type any non-numeric character you wish as a separator. On moving to another field Powerbase will re-format the date or time to use the separator specified in Preferences.
The use of wild-card characters is described in 2.5.5 and 3.5.3. By default "#" represents a single character and "$" a group of characters which need not be matched. You may change either or both wild-card characters if you wish in the same way as described above for date and time separators.
The descriptions given below refer to the action taken when the buttons are selected.
Record edits as CSV file causes a CSV file called NewDataXX to be created in PrintJobs. New and edited records are saved in this file which may then be used to enter data into another database. XX is a 2-digit number which is incremented each time the database is opened so that the results of successive editing sessions are saved as NewData01, NewData02 etc.
Launch new copy causes another copy of Powerbase to be loaded when you double-click on a database, instead of closing the current database. This can be useful if you want to access several databases at once, as one copy of Powerbase only supports the use of a single database. If there is a dormant copy of Powerbase on the iconbar (i.e. one with "No data" under its icon) then double-clicking a database sends it to that copy rather than launching a new one. With the button OFF double-clicking on a database closes down an already-open database before opening the new one. Even then you can load multiple copies of Powerbase by double-clicking on Powerbase itself and then open a different database in each by dragging the databases to the icons.
Case-sensitive queries makes operations involving the Query panel take account of the case of letters.
Recalculate on opening causes Powerbase to scan the whole file when the database is first opened, updating any Computed fields (see 6.1 and 6.2) whose associated formulae make use of the system variable TIME$. Those Computed fields which are analogous to time-related Stamp fields (see 4.2.10) are also updated. With the button deselected the contents of such fields are recalculated only when a record is displayed, which might not be good enough where, for example, TIME$ is used in a User function (see 6.3) to keep track of people's current ages.
Blank record on deletion causes the relevant record to be over-written with a blank record when its key is deleted from the primary key index. With the button deselected deleting a record from the database merely removes all references to its key from the index, leaving the actual record data untouched in the Database file. Although such "deleted" records will be overwritten when new records are entered, the situation may be deemed unsatisfactory from a security point of view since the "deleted" records can be examined by simply loading Database into Edit.
Keep descriptor with data affects the moving of fields during record design, making the descriptor jump to its "normal" position to the left of the data field as soon as you release the mouse button after dragging the latter. As noted in 4.2.1, the descriptor may be moved independently after the data field has been positioned but, even so, some users find this repositioning of the descriptor a nuisance and like to turn it off.
Validate input enables data validation (see Ch 5). If you ever find yourself unable to escape from a field linked to a validation table you can bring up the Preferences window, deselect this button and try again. You can also toggle validation ON and OFF with Shift-F9. The Table button on the tool-pane is shaded when validation is disabled.
Display linked table data displays a window showing data from the relevant validation table row every time the caret enters a field with a link to a validation table. This is either useful or infuriating, depending on your point of view. If turned off you can still call up the window for a specific field by double-clicking on the field with SELECT (see 5.5).
Warn of external deletion displays a message warning that you are about to delete the file linked to an External field (see 2.6.3).
Warn of duplicates The creation of records with identical primary keys can be prohibited if so desired (see 11.2.1). Normally, however, they are permitted. You may, if you wish, turn this button ON to issue a warning that such a record is about to be created.
Default action on Return According to the Style Guide for RISC OS typing Return anywhere inside a dialogue box ought to have the same effect as clicking on the default action button (that's the one with the yellow channel border) regardless of which writable icon the caret is in. If that's what you want then select this button. Many users (including the author!) hate it and prefer the default action to take place only if the caret is in the last writable icon when Return is typed. Hence the default setting, which is OFF.
Strip leading spaces causes spaces at the beginning of data fields to be stripped before the record is written to the file.
Strip trailing spaces causes spaces at the right of data fields to be stripped. Such spaces are usually the result of pressing the space-bar by accident when entering data quickly and are therefore unwanted.
Balance every <n> records forces rebalancing of the current index at regular intervals. The need to balance indexes and the use of this option is explained in 10.6.
Remember place in subfile ensures that, when hopping between subfiles, the first record displayed is the one you were looking at the last time you examined that subfile. With the button deselected the first record in a newly-selected subfile is always displayed.
Save marked status saves a list if records which are marked for printing etc, together with the include/exclude status (see 3.8).
Auto-open user menus causes field-linked user-menus to open whenever the caret enters the associated data field, without the user needing to click the menu button.
Re-load last report causes the last-saved report from a window to be automatically re-loaded and displayed on opening he database.
Query by example has already been described in section 3.6 in connection with creating reports. If selected it is active for all operation for which you would otherwise type a search formula into the Query panel, i.e:
Indexes are always saved whenever you close a database or quit Powerbase and only fear of power cuts or system failure (which includes some kind person switching off your computer!) need make you concerned about saving them yourself. With the Manual setting nothing happens during normal working unless you click Update on the tool-pane. Selecting Automatic or Warn only allows you to type in a suitable time interval (default = 10 min) at which Powerbase will either issue a warning to save your indexes (using Update) or actually save them for you.
When a record is displayed the caret is placed, by default, in the first editable field. Editing may be made to start at a different field by choosing Start editing from the Field submenu (see 2.5.4) or, alternatively, by placing the caret in the required field and typing Ctrl @. The tag of the relevant field is stored in this writable icon in the Preferences window and can be saved along with the other preferences.
As noted elsewhere (9.2) Powerbase can merge directly into a suitably-formatted Impression document by simply dropping the document icon onto the record window. The dialogue box which then appears contains a writable icon which shows the application with which Powerbase will merge. This name is, by default, "Impression", but may be altered by users for their own purposes. An application which will receive data from Powerbase in this way must make use of the ImpulseII protocols as defined by Computer Concepts. Even if you are using Style or Publisher the name to which these applications respond is still "Impression".
When using Ovation Pro you may, if you wish, alter this entry accordingly but it isn't actually necessary; Powerbase can tell from the type of the document dropped onto the record window whether you are using Impression or Ovation Pro.
This section of the window offers two ways of saving the settings - three if you are using RISC OS 3.5 or later. See 14.11 for a description of how these options work and the effect of the Load defaults button. The same ideas apply to any window from which choices may be saved and reloaded.
Section 8.2 explains how to access the CSV options window and what the pop-up menus and option buttons are for. The buttons for saving your choices work in the exactly same way as described above for Preferences, as do Accept, Cancel, and Load default. The file is saved as a plain text file called CSVoptions with the same choices of location as described above for Preference.
These are described at some length in Ch 3, especially in 3.10.2. All that needs to be said here is that the Save buttons work like those on the Preferences and CSV options windows except that you are offered a standard Save box and given the opportunity to give your own name to the file and save it wherever you like, the default being in PrintRes. It is anticipated that most users will have a need for several different print options files, differently named, for different ways of reporting from the database. Remember that a file called ! PrintOpts saved in PrintRes will be used as a default if no other settings are made. Powerbase's own default file is !Powerbase.Resources.!PrintOpts. You are reminded again that the choices in both windows are saved in a print options file.
These are more or less self-explanatory and are saved as a data file GridOpts in !Powerbase.Resources. No provision is made for saving files for individual databases, but if using RISC OS 4.33 you may save choices for an individual user.
These may be selected in a window reached by choosing Colours from the Miscellaneous submenu. The following default colours are used:
Type Foreground Background Descriptor of key field (inactive) dark blue light grey Descriptor of key field (active) red light grey Data icon of primary key field(s) black pale yellow Data icon of field linked to validation table dark green white Data icon of mandatory field red white
Clicking with SELECT on the descriptor and data icons within this window makes either the foreground or background (depending on the setting of the two radio buttons) cycle through the available colours. Clicking with ADJUST cycles through the colours in the opposite direction. The effect of the changes can be seen immediately.
Choices are saved as a file called FieldCols and the options are the same as for Preference etc.
Any button on the tool-pane or keypad may have its action duplicated by one of the keys F1-F11, with or without the use of Shift or Ctrl. Point at the button to which you wish to assign a key and click MENU to display the Keystroke menu. Assign leads to a window which shows the present key-assignment, if any. Use the "bump" icons to select the required function key and, if desired, select one of the buttons for Shift and Ctrl. Click on the Assign button and you will now find that the assigned key exactly mimics the action of the button. In three instances Powerbase will automatically assign keys with Shift for you:
Function keys may also be used to enter data into record fields or writable icons in dialogue boxes. The actual programming of the keys is done at the command line which is accessed by pressing f12. This takes you temporarily out of the desktop and gives you a "star" prompt at the bottom of the screen. Suppose you want to program f3 to enter the word "Powerbase". Type, at the star prompt:
and press Return twice to return to the desktop. The string assigned to the key may be entered by typing Ctrl Shift F3. Any of the keys F1-F9 may be programmed and the string is always entered by typing the key with Ctrl and Shift both held down.
A Powerbase database is normally controlled in four ways:
The plain text file !Powerbase.Resources. Config determines certain aspects of the program's operation which will seldom need changing. Changes made to Config take effect only when Powerbase is next loaded. Each attribute is identified by a token word and there is a comment line describing each. It is also possible to place a Config file in the computer's !Boot application, in the sub-directory pointed to by the system variable Choices$Write. Such a file will then be used in preference to the one in !Powerbase.Resources. See 14.11.1 for more details.
A database may also have its own Config file, placed inside the database directory, but some settings are only permitted in a "master" Config file located either in Resources or in !Boot. These are indicated by an asterisk in the following description. Each feature is identified by a token which is followed by either a numeric or string parameter and the order in which entries appear in the file is not important. Lines beginning with "|" are comments.
*Fields Maximum number of fields per record (default = 100, maximum = 127)
*Keys Maximum number of subsidiary indexes (default = 10)
*Tabs Maximum number of validation tables (default = 10)
*Cols Maximum number of columns in a validation table (default = 20)
*MaxLibs Maximum number of customisation libraries (see Ch.15) (default=10)
*CustDir Pathname of recommended directory for customised databases (default=Default, the directory containing Powerbase itself.)
*Scrolls Maximum number of scrollable lists (default=5)
*BTime Number of seconds for which start-up banner is displayed (default=2, maximum=5)
*LeftOpen Left-opening iconbar submenu (default=NO. Most users hate it but it might be preferred if the Powerbase icon is near the right-hand end of the iconbar.)
BackGnd Background colour for record window. (default=1, which also allows a background texture to appear if configured under RISC OS 4. Other numbers in the range 0-15 produce non-textured backgrounds in the standard Wimp colours. The colour can be set for individual databases but then affects only the background colour of field descriptors - not very useful.)
CBsize Width and height of Check-box icons (default=48,48 in OS units. Check-box icons need to be slightly larger than their sprites so that a noticeable black border appears when they are ADJUST-selected for printing. The RISC OS 4 sprites are smaller than those used previously and a setting of 44,44 still shows an adequate border. If you want to group Check-boxes so that they actually touch when stacked vertically the height can be reduced still further so that the horizontal borders disappear altogether.)
Margins Right and bottom margins of record window (default=16,16 in OS units. The record window is sized in such a way as to accommodate the longest and lowest fields, and the margins set here are additional to that minimum.)
ScrollBars Whether or not scroll-bars are present on the record window (default=YES, but small windows which don't need to be scrolled look tidier without them.)
ClearSel Clear print selection after creating report (default=NO)
AllSpaces Allow primary key to consist of spaces only (default=NO. A rare requirement requested by one particular user!)
Upper Force password entry in Access window to uppercase (default=NO)
DirOpts Display option for directories opened by buttons on the record window (default is -si, meaning "small icons". This may be changed to -li or -fi for large icons and full information respectively. The options -sn, -st, -sd, -ss, to sort by name, type, date and size may also be added after a space.)
ExtFiles (default=NEW. Method used for storing Text, Sprite and Draw files which are linked to External fields. You should not change this setting.)
PathLen Maximum pathlength for Remote filer objects (default=255; max. prior to RISC OS 4)
FontAdj Adjust width of data fields to take account of desktop font (default=YES)
Multi Continue to multi-task when printing lists, indexing etc. (default=NO)
Markpane Attach pane for marking records for printing etc. to record window. (default=YES).
NameLen Maximum filename length (default=10. If you regularly use something like LongFiles or raFS, or if you have RISC OS 4 and an E+ formatted disc, you might want to increase this value but beware if you give someone one of your databases containing saved files with names longer than 10 characters!)
ButtonAtts Attributes of Directory and Run file buttons when used on record window (see 4.2.11). (default=42, the width of the button in pixels. The sprite will be vertically, as well as horizontally, centred on the button unless you add L to the number. If you do so then the name of the attached file or directory will appear on the button underneath the sprite. You will almost certainly need to make the button much wider to accommodate the name.)
DialDelay Double-clicking with SELECT on a field containing a phone number whose tag or descriptor contains the string TEL (case insensitive) will attempt to produce dial-tones through the internal speaker. If you hold a telephone handset where it can "hear" the tones the number will be dialled. This Config option allows you to specify the delay in second between the double-click and the tones. (Default=5)
TimeFirst determines the interpretation of incomplete entries in Time fields (see 4.2.5) Default=H, which means first number entered is assumed to be Hours, next is Minutes and last is Seconds. S causes numbers to be interpreted in reverse order.
FullTime Either always display as hh:mm:ss (default=YES. Changing to NO allows mm:ss for times under 1 hour.)
Output What to do with output destined for the printer Default=1, send directly to the file called "printer:". 2 means send first to Wimp$Scrap then copy to printer: The latter may be needed to overcome problems with certain combinations of hardware and versions of !Printers.
This text file in the Resources sub-directory contains all the error and warning messages used by Powerbase including those for Acorn's interactive Help application. The wording may be altered if you wish. Many error messages contain the string "%0" and possibly "%1" and "%2". Data items are substituted for these when the message is printed so don't omit them or alter their logical placement within the message.
You might like the idea of having your database start up by displaying a pretty picture and/or some fancy text as an introduction. You can do this by devising a suitable sprite and saving the sprite file inside the database directory under the name Title. Only the name of the sprite file is important; the name of the sprite itself is immaterial and, if the file contains more than one sprite, the first will be used.
When the database is opened the sprite will cover the record window and is scaled to fit. The aspect ratio of the sprite is maintained, which means there will usually be strips of grey bordering the sprite, either at the sides or at top and bottom, since it is most unlikely that the record window's aspect ratio will match that of the sprite. If you want to display text it needs to be part of the sprite. The easiest way is to design your title screen in Draw then grab it as a sprite using Paint's "snapshot" facility.
As soon as you click on a tool-pane button, or anywhere on the title screen itself, the sprite vanishes. You can bring it back if you really want to by clicking ADJUST on the tool-pane's Stop button (which is not very intuitive but such a trivial feature hardly deserves a special button or menu entry to itself!). If you later decide to dispense with the title screen you should simply delete the Title file.
User-choices governing various aspects of Powerbase are saved in the following files:
Windows from which choices may be saved have a Save choices button and either two or three radio buttons to select the place where the choices file is saved. In all such cases one radio button is called in Powerbase. If this is selected the choices will be saved in !Powerbase.Resources. In a new copy of Powerbase the Resources directory contains none of the eight files listed above - not even Config. The files are present in another directory, !Powerbase.Initial, from which they are copied to Resources when you run Powerbase for the first time. However, each file is copied only if there is no file of the same name already present in Resources. This system is used because users often update Powerbase by dropping a later version on top of an older one. If they have altered the choices files to suit their own requirements the altered files will not be overwritten by the ones from Initial. It goes without saying that you should not alter any of the files in Initial and no means of doing so is provided from within Powerbase. One way of discarding an unwanted choices file is to delete it from Resources. The next time you run Powerbase the missing file will be identified and the "factory default" copied from Initial.
All relevant windows except those for grid options and keystroke equivalents also have an in database radio button. This allows the choices file to be saved within the database directory (in the database's PrintRes directory in the case of print-options files). Such a choices file will be used only by the database to which it applies and will be used by that database in preference to any other such file. Since choices of keystrokes and grid options are unlikely to vary with the database in use, no provision is made for saving database-specific Fkeys and GridOpts files.
All the choices windows have another radio button which is only selectable if you are using RISC OS 3.5 or later (it is shaded under RISC OS 3.1) and is of use especially to users of RISC OS 4.33, which supports individual users by providing a log-on screen into which a user name and optional password are entered. If that facility has been enabled there will be a private directory for each user in !Boot.Choices.Users and the system variable Choices$Write will point to the logged-on user's directory. When Powerbase is run it creates a subdirectory inside the user directory and choices files will be saved there if the aforementioend radio button is selected. The radio button itself is labelled for <username> leaving no doubt that you are saving choices for your use alone.
If your version of RISC OS doesn't have support for individual users the radio button will be labelled either Single (meaning single user) or Choices depending on how Choices$Write is set by the boot sequence. This is still a useful place to save choices files, although all users of the computer will be using the same files. To view the directory pointed to by Choices$Write, press f12 to access the command line, type: Filer_OpenDir <Choices$Write> and press Return.
If we consider one of the choices files, Preference, for example, you can see from the above that there could be as many as four copies to consider:
Simply clicking with SELECT or ADJUST reloads whichever file was originally loaded when the database was opened, as determined by the priority order described above. Thus, if there is a database-specific file then that will be loaded, the next choice is a user file and the final choice the one from Resources. There might be occasions when you wish to override this order. SHIFT-clicking will preferentially load your user file (if any), CTRL-click loads the file from Resources. You can even load the file from Initial by ALT-clicking.
It has already been mentioned that copying a newer Powerbase onto an older one will not overwrite files saved in !Powerbase.Resources. For RISC OS 3.1 users this is the only place (other than in an individual database) where such choices may be preserved. Users of RISC OS 3.5 or later are reommended not to use this method but to save the files to Choices$Write as described in 14.11.1. They will then remain intact even if Powerbase is accidentally deleted.