@database @node main Chapter01 "SBase Personal - 1. GETTING TO KNOW SBase 4" 1. GETTING TO KNOW SBase 2 @{" The Workbench Database " link 1} @{" Data Types " link 2} @{" Compatibility " link 3} @{" Installation of SBase 4 " link 4} @{" The Multi-Layered Database " link 5} @{" About this Manual " link 6} @{" The Primary Work Surface " link 7} @{" The Secondary Database Management Surface " link 8} @{" The Form Designer " link 9} @{" System Automation and Customizing " link 10} @{" Loading SBase 4 " link 11} @{" The SBase 4 Window " link 12} The SBase Menus @{" Ghost Items " link 13} @{" Selecting Commands " link 14} @{" Sub-menus " link 15} @{" Shortcuts " link 16} @{" The SBase Work Area " link 17} @{" Opening a File " link 18} @{" SBase 4 Requester Boxes " link 19} @{" Using Requester Boxes " link 20} @{" Using the Keyboard with SBase 4 " link 21} @{" Changing the Directory " link 22} @{" Path Names " link 23} @{" Choosing the CLIENTS File " link 24} @{" Record View " link 25} @{" Using the Browsing Controls " link 26} @{" Table View " link 27} @{" Page View " link 28} @{" Using a Form " link 29} @{" Exiting from SBase 4 " link 30} @{" Invoking the SBase 4 Form Designer " link 31} @{" Where To Go From Here " link 32} @endnode @node 1 The Workbench Database SBase 4 is a comprehensive, general purpose relational database management system designed to operate in the Commodore Amiga Workbench graphical environment. Its intuitive interface consistently employs the standard Amiga Workbench elements: icons, tools, gadgets, windows, requesters, directories (or drawers), projects and so on. This simplifies the learning process both for users already familiar with Workbench and for those using a Workbench application for the first time. In common with other Workbench applications, SBase 4 is flexible to configure and easy to install. It can be driven either using a mouse or from the keyboard. It benefits from the wide and well supported library of Workbench display and output device drivers. SBase 4 can perform the usual database management tasks of sorting, exchanging data with other applications and merging data files with text files with uncommon ease. In addition, its bit-mapped orientation makes it possible for SBase 4 to extend the range of functions offered by character-oriented databases in valuable new directions. Firstly, the bit-mapped orientation allows it to treat many types of graphical objects as data, including scanned or drawn images and drawings, thus dramatically increasing the information `band width.' Secondly it adopts a what-you-see-is-what-you-get approach to the design of business forms and reports. Graphical design elements may be incorporated into forms for more meaningful and motivating data entry and enquiry screens as well as published quality printed output. As a Workbench application, SBase 4 runs alongside other Workbench graphical and business applications, and can exchange data with them. @endnode @node 2 Data Types SBase 4 has the added bonus of having the ability to handle not only the text and numeric data typically organized by databases, but also sound and graphic files. In SBase Professional 4, full ANIMs can be played back as well. SBase 4 can utilize several graphic image types including IFF PCX ANIM (SBase Professional 4 only) @endnode @node 3 Compatibility SBase 4 in both its Personal and Professional versions supports AmigaDOS 1.3 and higher. They support any IFF files including graphical and sound files. In particular, SBase 4 supports screen resoulutions as high as 256 colors as well as the AGA chipset. @endnode @node 4 Installation of SBase 4 Appendix A describes how to install SBase 4. SBase 4 uses the Installer program from Commodore-Amiga which automatically installs SBase 4 to either a floppy drive or hard disk installation. Alternative icons for the SBase and the Form Designer are available in the Icons directory. International Characters In Appendix A is important information for those users who require the international character set. If you will be indexing data with special characters such as umlauts or grave accents, please turn to Appendix A. @endnode @node 5 The Multi-Layered Database SBase 4 is a multi-layered database system. SBase Personal 4 and SBase Professional 4 both incorporate user-oriented layers for the ready manipulation of straightforward filing systems. SBase Professional 4 adds developer-oriented layers for the design and programming of custom application suites based on sophisticated relational file structures. This multi-layered approach provides the user with a number of possible techniques for achieving any particular result. For the non-technical user, both versions of SBase 4 provide an intuitive primary work surface centered on the familiar metaphor of VCR controls. These controls provide immediate browsing access to data records in any sequence - get next, fast forward, get last, rewind, and so on - in a manner similar to the controls of a video cassette recorder. At an intermediate level, both versions of SBase 4 offer powerful relational capabilities without programming, including cross-file lookups and calculations as part of the file definition process, and the formulation of re-usable multi-file queries. A separate easy-to-use forms design surface provides extensive tools for creating WYSIWYG forms and reports from a wide range of design objects, including lines, boxes, areas, text, digitized images and other graphics, fields from any file, calculation formulas, and command calls. Forms can incorporate one-to-many relationships, with relations being displayed graphically as part of the forms design process. Forms can then be accessed for browsing and data entry from within the primary work surface. SBase Professional 4 offers the technical user the further layer of a full-scale Database Management Language (DML) . This language allows the user to write highly customized applications using SBase. There is even a Run-Time module for the Professional program which can turn a DML application into a stand-alone application that does not require SBase Professional 4 to run the application. If you are interested in becoming a SBase developer, contact Oxxi for details. Both versions of SBase 4 now offer the technical user the further layer of function key assignments. Many complex activities, such as one-to-many forms browsing or multi-column label printing, may be accomplished either from the menu, or by assigning it to a function key. All the browsing, relational reporting and forms design tools provided with SBase 4 operate directly on files in dBase II and dBase III format, as well as files created or imported using any database of SBase or SBase version 1.3x program on any machine. @endnode @node 6 About this Manual This manual discusses the basic database features, Text Editor features and Form Designer features. Most elements are common to both SBase Personal 4 and SBase Professional 4. Where there are distinctions, they are so noted. The SBase Professional 4 product includes a second manual called - Database Management Language and Applications Guide. This manual discusses the DML language and other features exclusively found in the SBase Professional 4 product. @endnode @node 7 The Primary Work Surface SBase 4 presents the user with an everyday work surface which combines instant familiarity with near infinite flexibility. You can define and refine file structures, even when a file contains data, without any need to rebuild them. There are no practical limits to the numbers of fields or to the record length. You can retrieve data in any form or order you wish. Using simple menu commands, you select the required fields, place them in any order, choose page or table orientation, and switch to your preferred index sequence. The VCR-like controls at the foot of the work area allow you to scan files, look up records, apply filter conditions, or simply step through your records one at a time. Information retrieved in this way can be printed with a single menu selection. Included as part of the primary work surface is the SBase 4 Text Editor. This handles files in ASCII or ANSI format, as well as its own format. The Text Editor is intended as a no-frills tool for supporting database operations, and includes cut and paste, search, and a direct merge interface to data files. @endnode @node 8 The Secondary Database Management Surface SBase 4 also offers a deeper layer of functionality, to which users naturally turn as they become more familiar with the primary work surface. The secondary database management surface allows users to exchange data with other programs via a range of import and export formats, design re- usable multi-file queries and global updates, and produce formatted reports. A communications function gives you access to remote systems via modem. @endnode @node 9 The Form Designer The Form Designer module allows you to design forms for screen input, browsing, and printing, using a full range of graphic objects and editing tools. You may include fields from many files on a form, which may in turn have multiple pages. The Form Designer Pro in SBase Professional 4 adds the ability to define a block of fields as `transaction lines,' so that one-to-many file relationships can be managed without programming. Field data may be displayed and printed in different fonts. Calculation formulas may be incorporated to give the form powerful processing capabilities. In SBase Professional 4, the Form Designer also includes a Report Generator, which allows you to build precise report definitions with simple point-and-click techniques. The Report Generator creates a simple SBase DML program, which is available to run immediately, or for fine-tuning in the built-in Program Editor. Many reporting activities can be accomplished with the Query command available in both the Personal and Professional products. @endnode @node 10 System Automation and Customizing When you are ready to automate your system, there are many techniques available to suit individual preferences. Global queries, updates, and label formats are all re-usable disk files. And the user-definable function key feature lets you create and store any number of sets of up to 40 function key strings. SBase 4 includes an integrated graphics file handling capability unique in its class. Bit-image PCX and GIF files, and ILBM, Dynamic HiRes and Dynamic HAM types of IFF files, can all be displayed from within the primary work surface, by defining a field as `external' and storing filenames in it. External text can also be displayed. Using forms, data, images and text may be displayed and printed directly. This feature enables users to apply the power of database organization to the image files generated by scanners and digitizers as well as graphics software. The rest of this chapter provides an introduction to the basic database program, designed to get you working productively as quickly as possible. @endnode @node 11 Loading SBase 4 Once SBase 4 has been installed following the procedures in Appendix A, the procedure for loading SBase 4 is: For Floppy drive users: Insert a Workbench disk in drive 0 and start up the Amiga. Double-click on the SBase icon. For Hard drive users: Double-click on the drawer where SBase has been stored. Double-click on the SBase icon. Then you are given a choice between SBase 4and its Forms Designer double-click on the SBase 4 icon. The Professional version program icon is named SBase4Pro, while the Personal version icon is named SBase4Per. If you want to open the Form Designer, the professional version icon is SBFDPro and the personal version is named SBFD. *** @{" See Fig 1-1 " system "ps sb2:fig1-1"} *** *** @{" See Fig 1-2 " system "ps sb2:fig1-2"} *** *** @{" See Fig 1-3 " system "ps sb2:fig1-3"} *** @endnode @node 12 The SBase 4 Window SBase 4 functions like most other Workbench applications. If you are already familiar with how such applications work, you will be able to skip over some of the following sections. The title bar at the top of the window displays the name of the current SBase 4 File and Index. The path name is also shown if there is one. The following page show the menus for the SBase program. The Personal version does not include the DML menu shown. An explanation of the DML menus is discussed in the User's Guide to the Database Management Language. @endnode @node 13 The SBase Menus Ghost Items Menu items that are temporarily unavailable are shown in gray script, and are known as `ghost' items. We use this feature in SBase, most obviously during this start up phase when no file is open. To see this, press the right-hand mouse button and move the pointer to the Edit Menu. You'll see that all the items on this menu appear to be faint, as if only half the dots that make up each letter were being used. If you try to select a ghost item, nothing will happen. A quick look at the browsing controls at the bottom of the screen will reveal most that most of the control buttons are also ghost items while no file is open. @endnode @node 14 Selecting Commands The way you select commands in SBase is exactly the same as using the Workbench itself. You use the mouse as follows: 1. Press the right hand mouse button to display the names of the available menus in the menu bar. 2. Keep the button held down while you move the pointer to the menu item you want. 3. Release the mouse button to run the selected command. @endnode @node 15 Sub-menus Many menu items are followed by a `¯' symbol. Selecting any menu item so marked causes a sub-menu to be displayed in addition to the main menu. This happens whenever you need to make a further choice. For example, if you display the `Project' menu and select `Open' then a sub-menu is displayed allowing you to specify what you want to open: File, dBase File, Index or Form. Keeping the mouse button held down, move the pointer into the sub-menu, point to the item you want, and release the button. @endnode @node 16 Shortcuts For some operations, SBase provides shortcut key combinations, which you operate by holding down the right-hand Amiga key while pressing another key. These shortcuts allow you to select a menu command without having to pull down the menu first. So, for instance, you can display a list of file names by holding down the right-hand Amiga key while pressing the L key. Combination key shortcuts are shown on the menu to the right of the command name. Note that shortcuts will not work while a menu is on screen. (In some cases you may use either the left-hand or the right-hand Amiga key.) @endnode @node 17 The SBase Work Area The work area is SBase's permanent window onto your database. It's like a large worksheet, 273 columns across; the number of lines you can see depends on the size of your window. SBase uses the work area to show data, either with or without a form. With a form, data from several files can be shown at once. Without a form, SBase shows just the records in the current file, as well as the results of some other operations. *** @{" See Fig 1-4 " system "ps sb2:fig1-4"} *** When a form is not being used, records may be shown in one of three default Views: Record, Pageand Table. - Record View displays data one record at a time, with one field per line. - Table View displays data one record per line, with up to 273 characters of data from each record. - Page View displays data one record at a time in a page orientation, with fields dragged into position by the user. The basic facilities for managing data allow you to tailor the way data is presented in the work area. - You may select fields to view, and the order in which they appear. - You may select any index to determine the sequence in which the records appear. - You may select a subset of records from the file by means of a filter. You use the scroll bars to move around the work area and look at data which is not immediately visible. At the bottom of the window are SBase 4's browsing controls, which give you immediate access to your database via a simple and familiar model. Most of the twelve browsing controls are modeled on the controls for a video cassette or tape recorder, so you will find their meanings easy to learn and remember. @endnode @node 18 Opening a File In this section you will open a file, learn about SBase 4 requesters, practice switching Views, and use the browsing controls to step through records. To begin, select Open File from the Project menu. SBase 4 displays the following requester box: *** @{" See Fig 1-5 " system "ps sb2:fig1-5"} *** @endnode @node 19 SBase 4 Requester Boxes Many of the commands on the menus are followed by `...'. These three dots indicate that after choosing the command, you will be presented with a requester box. We refer to these simply as requesters. SBase 4 uses requesters to communicate information to you. For example, the requester you've just selected is the Open File requester.Requesters like this one are used in most SBase operations. They communicate messages to you and require you to perform a specific action. This action involves making selections from a list or typing in a number or a text value of some kind. Many requesters show a box that contains a list of items such as file names or field names. This is called a list box. The box may be only a few lines long, so there may be more files or fields than can be shown at one time. If there are more items to be viewed, you can show them by dragging down the scroll bar at the right of the box, or by clicking on the downwards pointing arrow gadget below the scroll bar. One very important fact about requesters is that you must respond to them before you can do anything else. Most requesters have a Cancel button. Clicking this, or pressing the ESCAPE key, returns you to whatever you were doing previously. If there's no Cancel button there is certain to be an OK button, and you can safely click this, or press the ENTER key, once you've read the requester. Many SBase requesters include a Clear button. This has the effect of removing anything that's in the text box, and can be used at any time. @endnode @node 20 Using Requester Boxes The simplest requester boxes contain just a text message and the OK and Cancel buttons. More complicated requesters may also contain a variety of other features: - List boxes. These can show file, field or directory and drive names. - Text boxes. When you select an item from a list box, it is automatically placed in the text box. This is also where you type in text. - Radio buttons. If a command offers you a choice of options, each may be represented in the command's requester by an option button. - Check boxes. Unlike option buttons, check boxes are independent of each other, so you may choose more than one at a time. - Push Buttons. These are buttons such as OK, Clear, Cancel, Add, and Delete, which initiate an action from the requester. Use the mouse to select items in a requester. To select an item, you point to it and click once. Clicking on the OK command button then completes the operation. When you are selecting items from a list box, you can also carry out this procedure in one step by double-clicking on the item. If you prefer you may press the ENTER key as an alternative to clicking the OK button, and press the ESCAPE key instead of clicking the Cancel button. @endnode @node 21 Using the Keyboard with SBase 4 To avoid cumbersome repetitions, we shall usually assume from now on that you are using a mouse. Instructions, for example, will refer to clicking on the OK button rather than to pressing ENTER. @endnode @node 22 Changing the Directory The Open File requester is one of a number of SBase 4 requesters that present you with a list of file names. They all have these features in common: - The name of the requester at the top. - The current directory, below the requester name. - A file name box on the left. - A directory box on the right. - A text box below the file and directory boxes. - OK, Clear and Cancel command buttons. In the text box, SBase 4 places a pattern matching string which restricts the files to those of a particular type. For example, the Open File requester is used for opening database files. These have SBF as their extension name, so the Text box selects them using the pattern matching string: *.SBF In most file opening requesters, the file name box only shows the names of the files in the current directory that are appropriate to a particular command. The Open command is used to open database files, so its requester only lists files of this type. Likewise, the Query Open requester lists query files. If there aren't any files of the type required in the current drawer, the file name box will be empty. Note The pattern matching string cannot be edited in file opening requesters where the file names are shown without their extensions. With other requesters - such as the Export File Name requester - SBase 4 uses `*.*' as the pattern matching string. In this case, it is possible to edit the string and you may wish to do this in order to restrict the list of files to those with a particular extension. When you load SBase 4 for the first time, the current directory is the one in which you installed SBase 4. Generally, this directory is not the same as the directory or drive where you keep your data. You can check this by looking at the Open File requester. If the file name box is empty, it means that the current directory does not contain any database files. You use the box on the right of the requester to change to a different directory. In this box, drive and directory names are shown; drive names end with a colon (`:'). The directory one level up from the current directory (the parent directory) is represented by `/'. Double-clicking on a drive or directory name in the right-hand box causes that one to become the current drive or directory, and the list of file names displayed in the left-hand box changes to show all the files of the relevant type that are now available. SBase allows you to open multiple files from different directories. The only restriction is that Query and Update files must be in the same directory as their associated database files. When you are opening files in other directories, the most recent directory in which you have opened a file becomes the current directory. For the rest of this session, you will be using the CLIENTS file which is supplied with SBase as a demonstration file. Before proceeding, you need to change to the directory or drive which holds the CLIENTS file. On the Examples disk this can be found in the Trading directory. The demonstration files are supplied on a separate disk to SBase 4 itself. You may have already copied them to a data directory on the hard disk. If the name of the data directory is shown, you can change to it by double clicking on its name in the directory box, or by highlighting the name and pressing ENTER. If it does not appear in the directory box, you should first change to the parent directory by selecting /. @endnode @node 23 Path Names SBase 4 also allows you to select a file by typing its name in the requester's text box. If the file is on another drive or in another directory, you will need to give its path name. The text box acts as a scrolling window on the path name and file name. If you enter a character string longer than the window, it scrolls to the right. If you want to correct what you have typed in, you can scroll the window to the left using the LEFT key. Here are some examples of the way path names are used: dh0:Trading/CLIENTS This uses the drive specifier dh0: to select the CLIENTS file which is stored in theTrading directory which is stored on the root directory on the disk dh0. dh0:sb4/CLIENTS This selects the CLIENTS file which is stored in the sb4 directory on disk dh0. If the directory path is shown, you may specify a path name in any requester which is used to select files. SBase 4 accepts path names up to 66 characters long (not including the filename). Note When the drive specifier is not given, the path name you type in is appended to the path name for the current directory; for example, if you enter sbdata/CLIENTS and the current directory is dh0:sb4, SBase will look for the CLIENTS file in dh0:sb4/sbdata. For this reason, you are advised always to enter the full path name including the drive specifier. @endnode @node 24 Choosing the CLIENTS File After selecting Open File, change to the directory where the CLIENTS file is stored. Now move the pointer to the file name box on the left. Point to the file name CLIENTS and click once. SBase 4 copies the name of the file you've selected into the text box. (If you see the wrong file name in the box, move the pointer carefully onto the right file name, and click again.) Once you've selected the file, move the pointer onto the OK button and click once. SBase 4 now opens the CLIENTS file. As a faster alternative to this procedure, you can double-click the name to open the file without pausing to click on OK. @endnode @node 25 Record View When SBase 4 opens a file from the start up screen, it automatically reads the first record in the file and shows it on the Work Area screen in the default View, which is Record View. You'll see the name of the file appear on the title bar at the top of the window, followed by the name of the field on which the file is currently indexed. *** @{" See Fig 1-6 " system "ps sb2:fig1-6"} *** In the Work Area, the field names for each record in the CLIENTS file appear down the left-hand side of the screen. The data for each field is displayed to the right of its field name. If the data for a field is wider than the window, it extends off to the right. You can bring it into view using the scroll bar at the bottom of the window. Remember that if there were more fields in the record than you could see, you could view them by dragging the scroll bar at the right of the window downwards, or by clicking on the downward pointing arrow. @endnode @node 26 Using the Browsing Controls The browsing controls are a key part of SBase 4's primary work surface, providing a set of tools for instant and intuitive file management. *** @{" See Fig 1-7 " system "ps sb2:fig1-7"} *** The VCR Browsing Control design is a registered trademark of Software Publishing Corporation. You can select individual records or scan through a file with a single mouse click or keystroke. What follows here is a simple step-by-step our of some of the browsing controls. Full details are given in Chapter 10 Retrieving Data Interactively. See Chapter 33 SBase Program Command Reference Summary for a list of the keyboard equivalents to the browsing controls. 1. Click the right arrow button to select the next record in the file. Repeat the action to retrieve more records. 2. Click the left arrow button to select the previous record. 3. Click the third button from the left to return to the first record in the file. 4. Click its mirror image button, fourth from the right, to go to the last record in the file. 5. Click the double left arrow button to start a rewind back to the start of the file. 6. Click the double right arrow button to start a fast forward scan through the file. 7. Click the pause button, the leftmost button, to halt either a fast forward or a rewind scan. Click pause again to restart. 8. The up and down arrow button rereads the current record. If you have a multi-page form open, this button switches between pages. 9. The second button from the left, stop, ends a forward or rewind scan. @endnode @node 27 Table View Switch to Table View by selecting the Set Table View menu command. This places the field names across the top of the screen, and the record data in a row under them. Select the next record, using the appropriate browsing control or its keyboard equivalent. The data for the next record is displayed. You can use the same browsing controls you used for Record View with Table View. *** @{" See Fig 1-8 " system "ps sb2:fig1-8"} *** When the screen is full, the pause button is highlighted. To continue with the display, press the space bar or click the pause button. You may move a column to the left by dragging it. Double-clicking on the column restores it to its original width. @endnode @node 28 Page View Now switch to Page View with the Page View command on the Set menu. The display changes to a layout in which each field is positioned independently. In this view, it is possible to have more than one field on a line. If you wish, you may move any field simply by dragging it to a new position. The only restriction is that you cannot position one field on top of another. The browsing controls work as before. *** @{" See Fig 1-9 " system "ps sb2:fig1-9"} *** Fields can be positioned anywhere in the 273 column by 256 row work area, so you can design page layouts to incorporate very large numbers of fields. There is an option to switch field names off before printing, allowing you to print record data directly onto preprinted stationery. @endnode @node 29 Using a Form Record, Table, and Page Views provide instant access to stored information without the need for any prior screen formatting. More sophisticated views can readily be designed using the SBase 4 Form Designer. Let us now see a form in action by opening the Clients form supplied with your model application. Select the Open Form command on the Project menu. The requester works in exactly the same way as the Open File requester, except that it only shows disk files in the current directory with the SBV extension, indicating that they were created with the Form Designer. A typical form might appear as follows: *** @{" See Fig 1-10 " system "ps sb2:fig1-10"} *** Open the Clients form. You will see that only some of the fields in the Clients file are shown; this illustrates one of the benefits of forms - by selecting only the fields relevant to a particular purpose you can make it easier to read records when browsing. You may set up any number of different forms for the same file, some for browsing, some for data entry, some for printing, and of course different users of the database will require different levels of access to data. The browsing controls work in exactly the same way when a form is open. You may step through records individually or scan them with fast forward or rewind. If you look at the Set menu while a form is open, you will see that the Form command is now selected, whereas Table, Record, and Page View are all deselected - none of them has a check mark. You may return to any of these views by selecting the appropriate command. When you want to see the form again, reselect the Form command on the Set menu. @endnode @node 30 Exiting from SBase 4 When you want to leave SBase 4, you can do so by selecting the Quit command on the Project menu, pressing AMIGA+Q or by clicking on the box in the top left-hand corner of the SBase 4 window. @endnode @node 31 Invoking the SBase 4 Form Designer You may also run the Form Designer from within SBase 4. - Select Open Form or Modify Form from the Project menu. - If a form is already open in SBase 4, the Form Designer opens it ready for editing. When you reactivate SBase 4 it checks to see whether the form it has in memory has changed on disk. If it has, SBase 4 reloads the form. This allows you to save the form you have been editing, and simply click in the SBase window to use the new version of the form. @endnode @node 32 Where To Go From Here This chapter covers the essential information you need to begin using SBase 4 effectively: opening files and forms, viewing records, and using the browsing controls to review data files. If you are new to databases, you are recommended to read Chapter 45 Learning to Use SBase 4. This provides 13 tutorial lessons covering most of the basic SBase 4 operations. More experienced users may also want to consult the tutorials as a supplement to some of the topic descriptions given elsewhere in the manual. As the Contents pages will show you, the rest of the manual is organized around specific database topics. Each chapter explains how to perform a particular task. The Form Designer is discussed in greater length starting in Chapter 33. Note You must define a file before you can create a form to use with it. If at any time you need a quick explanation of a SBase 4 program command, turn to Chapter 32 SBase Program Command Reference Summary. This gives a brief description of each of the menu commands and also lists all the key controls and keyboard equivalents. @endnode