Classic Computer Magazine Archive START VOL. 4 NO. 10 / MAY 1990


Organize! See INFOBASE.ARC and INFO_SRC.ARC on, your START disk.

InfoBaseST is a structured database with a twist. Not only does it let you specify fields, it also lets you design their appearance and screen placement - you aren't locked into one predetermined format. Add to this versatility the power of flexible searching, sorting and output and you have a dependable, valuable workhorse.

Getting Started
To use InfoBaseST, copy the files ARCX.TTP and INFOBASE.ARC onto a blank, formatted disk and un-ARC the file following the instructions elsewhere in this issue. On the disk you'll find the database program itself, INFOBASE.PRG and the help file, INFOBASE.HLP.

InfoBaseST was written in OSS Personal Pascal version 2. The source code is in the file INFO_SRC.ARC. To examine the source, copy ARCX.TTP onto a blank, formatted disk. Leave INFO_SRC.ARC on a separate disk, unless you have a double-sided drive. Un-ARC the file following the instructions elsewhere in this issue.

To run the program, double click on INFOBASE.PRG at the Desktop. It first checks for the presence of INFOBASE.HLP in the same folder as itself. If the help file isn't found, you're given the option of continuing or aborting. If you continue, obviously, the help facility is useless. With the help file in its proper place, press [Help] to
call up a screen that lists your current choices and other help topics.

Modes
InfoBaseST operates in five modes: Design, Input, Search, Sort and Output. Different features are available depending upon the mode. You can choose the mode, or any other operation, with either a keyboard or a mouse command (see the sidebar for a summary of keyboard commands).

A message line sits underneath the menu bar. The information within it changes depending upon the mode. The rest of the screen is used to display the database. Only one record at a time appears, which means that the format you design must fit within this area.

Design
Before actual data can be entered or retrieved, you must design a new database or recall a previously saved database design file. The program opens in Design mode, or you can enter it by choosing Design [Alt]-[D] from the Mode menu. The message line gives the current cursor position.

Recalling a saved design file is as easy as choosing Open [Control]-[O] under File. Your file-selector utility takes over and a list of format files, which have the extender .SCR, appears. The new format replaces the current one in memory.

To create a new database format, select Enter [Control]-[E] from the Design menu. You're given a dialog box. Let's step through its inputs.

The field label precedes the field. It's there to help you identify a field's contents, but it isn't required. If you don't label a field, two blank spaces are placed before it anyway. Field labels aren't printed during output.

The X and Y coordinates determine a field's placement on the screen. When you enter the dialog box, X and Y give the current position of the cursor. If you change X or Y while in the dialog box, the field is placed at that new location. The top left corner of the screen matches the coordinates (1, 1).

Select a datatype with the mouse. The difference between Name and String is the manner in which searching and sorting is performed. Enter names in first-middle-last format. The program automatically rearranges them to last-first-middle for the sort or search routines. String makes no such assumptions. Name also creates a subsidiary field following the Name field. This unnamed field is a boolean field used to designate company names that should not be alphabetized or sorted like a regular name, but rather like a string. Enter a T to designate a Name field as a company name. Enter F or leave the field blank to designate a regular name.

DataType    Description/Features

String           Series of alphanumeric characters [Default].

Boolean      T, F or blank.

Integer         Up to 11 digits of precision.

Real             11 digit mantissa, -38 to +38 exponent.

$ (dollar)     Maximum precision $999,999,999.99. Above will have rounding error.

Date             Month/Day/Year formal. Month as number or letters. Year in 2 or 4 digit format. Dividing characters anything but number or letter. Name Enter as first-middle-last format. Automatically modifies to last-first-middle for search and sort.

Size the length of the field by modifying Max Size. Its default is 10. The Real datatype can be customized by modifying Real Decimal, which determines the number of decimal places to be displayed. Its default is 5.

Select Continue from the dialog box and, voila, your customized field label and input area appear on the screen, with the cursor on the line below it. Now you can repeat this process for additional fields. The next field will appear at the cursor's location. You can move the cursor with the arrow keys or by pointing the mouse and left-clicking.

Once your design is complete, select Save [Control]-[S] from the File menu. If you don't save the design, a prompt will appear when you exit the program. If the file already exists, it will be renamed with the extender .BSC. if a backup file exists, it will be lost.

Modifying Fields
To modify an existing database field, position the cursor anywhere in the field and select Modify [Control]-[M] from the Design menu. Enter the changes and select Continue or select Delete to delete the field. A field can also be deleted on screen by positioning the cursor within it and selecting Delete [Control]-[D] from the Record menu.

If a field's position overlaps that of another, InfoBaseST returns you to the Modify screen. Select Delete to exit this cycle (and delete the record) or change the X and/or Y position to one not already occupied. The program modifies the size of X or Y values when they don't conform to the screen size. You're prompted if a change is made.

A field can be repositioned by placing the cursor anywhere in the field and pressing [Shift] and the arrow keys. You can move the entire field anywhere, but you can't overlap fields. The entire design can be erased by selecting Clear [Control]-[C] from the File Menu or clicking on the window clear box in the upper left-hand corner.

Input
Select Input [Alt]-[I] from the Mode menu. Loading a saved design file also puts you into Input mode. The message line shows the datatype of the current field, the record number of the current record and the total number of records.

Place the cursor in a field and type in its data. If it's a data field, pressing [F10] will enter the current system date. Return takes you to the next field and the arrow keys move you around all the fields. You can also use the mouse to position the cursor.

Data length is limited to the size of the box. [Esc] clears a field. New Rec [Tab], from the Record menu, takes you to a blank record at the end of the database. Also on the Record menu are First Rec [Control]-[Left Arrow], Last Rec [Control]-[Right Arrow] and Delete [Control]-[D], which applies to the current record. [Undo] retrieves the last deleted record.


Sample InfoBaseST screen.

Write the database to disk by choosing Save [Control]-[S] from the File menu. It will be saved with a file extender of .DAT. If a file with the same name exists, it will become the backup file, with extender .BDT. If a backup file already exists, it will be lost.

To retrieve a saved database, select Open [Control]-[O] from the File menu. Database files have the extender .DAT. If a database already exists in memory, you're given the option of merging the old and the new or abandoning the existing database.

The size of fields in the database and the design format must match. If they do, the data will be loaded. If not, you'll be requested to instruct the program on how to interpret the stored data.

Loading a Dissimilar Database
A database created with a customized format different from the current one can be loaded into InfoBaseST, but you first must tell the program which fields to equate.

The message line displays information about your database fields (disk size) and your design fields (memory size). For example:

{Database to be loaded}        {Current format}
Disk: Name/30 I Label : Author II Design: Name/30

The database field is datatype Name, size 30, with the label Author. The current design format field is datatype Name, size 30. These two are easy to equate; both the type and size match. Simply click the right mouse button to tell InfoBaseST to load the Author field into the current Name field.


InfoBaseST accepts both keyboard and
mouse commands.

If you want the current database field loaded into a different design field, use the left mouse button or keypad to move the cursor to the field you want, then click the right mouse button.

An asterisk appears on the screen next to the selected design field and information about the next database field appears on the message line. To skip a database field, select Next [Shift]-[Right Arrow] from the Record menu. To move to a previous database field, select Previous [Shift]-[Left Arrow] from the Record menu. When all of the fields have been chosen, select Quit [Control]-[Q] from the File Menu and the disk database loads into the screen design in memory. Data may be clipped if the database field is longer than the design field.

Search
Select Search [Alt]-[F] from the Mode menu. (I used F for Find since S was needed for Sort.) A blank design format appears. In the appropriate fields, enter a search template. You can use the asterisk (*) for a wild card. For example, Smith finds all persons with the last name Smith, while John finds all persons with the first name John. *Ann* finds everyone with Ann as any part of their name. Remember, Search is case sensitive.

For each field, you must also enter a search criteria. This tells InfoBaseST how to compare records to the search template. The default criteria is '='. The message line displays a list of valid search criteria and the chosen search criteria for the current field. For example, searching a money field with a template of 200.00 and a criteria of '<' finds all amounts of $199.99 and less.

When you've entered your template and criteria, select Search [Alt]-[F] from the Record menu. When the search is done, you'll have access to only those records which the search found, You can scroll through the search subset as usual, edit the records and save them. The message line tracks your position in the subset and continues to display information about the searched database.

When you're through with the search subset, select Input [Alt]-[I] from the Mode menu. If no records match your criteria, you'll automatically return to Input mode. Search finds records that match every field for which you specified criteria, for example, under $200 and named Smith.

An OR Search
InfoBaseST can do "or" searches. For example, it can find the records of every president who was named Roosevelt or was born in Illinois.

First search for all presidents with the last name Roosevelt. Then, while still in Search mode, select Search [Alt]-[F] again. An alert box opens and asks for the disposition of your current search list. Pick the OR button. (NEW abandons the current search list and Cancel returns to the current search list.)

Next, enter Illinois as the search criteria for the place of birth (leaving the name field blank). The program will search the entire database and add those records that match the second search to the initial list of presidents named Roosevelt. Duplicate records (Name = Roosevelt AND birthplace = Illinois) will be displayed only once. This sequence can be repeated as often as you want as long as the program remains in Search mode.

Select Save [Control]-[S] in Search Mode to save only the records selected by the search routine. InfoBaseST will still have the name of the original database as the default, so be careful to specify another or else you may risk overwriting the original database.
 
 
Disk-File Types
There are six file extenders utilized by InfoBaseST.
 
Extender
 
Use
 
.SCR Screen design
.DAT Database storage
.PRT Report design
.TXT Report output to disk
.BSC Backup screen design
.BDT Backup database
 
When loading or saving a file, the file selector will prompt with the proper extender.

Command Summary               (^=[Control])
Menu Command Keyboard General Description
File Open ^O Open a disk file
  Save ^S Save a file to disk
  Clear ^C Clear current screen
  Quit
 
^Q
 
Exit program
 
Mode Design Alt-D Enter Design mode
  Input Alt-I Enter Input mode
  Search Alt-F Enter Search mode
  Sort Alt-S Enter Sort mode
  Output
 
Alt-O
 
Enter Output mode
 
Design Enter ^E Enter a data field
  Modify
 
^M
 
Modify a data field
 
Record Search Alt-F Process search request
  Sort Alt-S Process sort request
  Next Sh-> Move to next record
  Previous Sh<- Move to prev record
  FirstRec
 
^<-
 
Move to first record
 
Record Last Rec ^-> Move to last record
  Delete ^D Delete current record
  New Rec
 
TAB
 
Create a new record
 
Output Print   Output to printer
  Disk   Output to disk
  Screen
 
  Output to screen
 
Non-Menu Commands
 
F10 Enter current system date into date field
Fl Toggle field selection list in Output mode
F2 Toggle field selection list in Output mode
Undo Recall last deleted record
In addition to the above cursor commands, the vertical scroll bar and arrows can be used to traverse the entire database in Input mode or the selected records in Search mode. The location of the scroll bar graphically illustrates the current location in the database.

Sort
Select Sort [Alt]-[S] from the Mode menu. The message line gives the key commands for ascending [Shift]-[Up Arrow] and descending [Shift]-[Down Arrow] sorts.

Place the cursor in the field(s) upon which you want to sort. Choose an ascending or descending sort. An up or down arrow and a number (if the field is longer than one character) will be displayed in the selected field. The number indicates the field's place in the sort order. The 1 field will be the primary sort key. The 2 and above fields will only be used if the earlier keys are equal.

If you make a mistake, pick Input [Alt]-[I] from the Mode menu to exit Sort, then choose Sort [Alt]-[S] again and start over. When all of the desired fields have been defined, select Sort [Alt]-[S] from the Record menu to begin. The sort may take some time, so be patient.

When the sort is complete, the program automatically reverts to Input mode and displays the first record.

Output
Select Output [Alt]-[O] from the Mode menu. Output mode can be entered from either Input or Search mode. A dialog box appears.

At this point you can retrieve a previously saved output format. Choose LOAD and select the format file, which has an extender of .PRT.

If you want to create a new output format, customize the items in the dialog box. Select the type of output: Report, Single Label or Multi Label. Single Label prints only the current record displayed on the main screen. Multi Label and Report both print the entire database, or search subset.

Report will print information in a columnar report format, with room for text at the head and foot of each page, while the two label selections output each record to a form, such as a label, RolodexTM card or index card.

Report Lines specifies the number of lines (1-4) each record is allowed in Report format. Label Lines gives the number of lines (1-10) on each label. Top Lines and Bottom Lines are the number of blank lines (0-99) at the top and bottom of each label.

You're also given the choice of several special print modes. WIDE prints 132 columns and requires a wide carriage printer, or prints 80 columns condensed on a standard printer. WIDE, BOLD, ITALICS and SPECIAL require you to specify the printer initialization code sequence, unless you select WIDE and are using a wide-carriage printer. Enter the decimal numbers, separated by a space, of the commands found in your printer documentation.

Abort returns you to the mode you started in, either Input or Search. Nothing will be printed. To design your output format, select Continue. The output design screen will appear.

Output Design Screen
The top of the screen displays the first 10 fields of the current database. Go to the next 10 using [F2]; return to the previous 10 by pressing [Fl]. You can also use the vertical scroll bar.

If you loaded a saved output format, it is displayed in the bottom half of the screen. Otherwise, the bottom of the screen is blank.

Report
Database fields can only be located between the two horizontal lines in the bottom half of the screen. To select a database field, position the cursor using the mouse or arrow keys, then select the field from the list at the top by pointing to it and left-clicking the mouse. The appropriate letter will appear in the design area, repeated for the length of the field.

The areas above and below the lines are where you enter the header and footer information that appears on every page of the report. You can type in straight text or use the following special commands:

@Date    print the current dote

@Page   print the current page number

@Line    print the current line number

@Rec#  print the current record number

@Null    do not print the extra spaces for each field (The line will not be forced to print in columnar format, with extra spaces included to make all lines start at the same position. It is useful for addresses; for exampIe.)

Label
Designing a label is identical to the procedure above, except the entire screen, up to the number of Label Lines you specified, is available for database field placement. Any text you enter will be printed on every label, exactly as written.

Output Mode Options
While in Output mode, you can use any of the options under the File menu. Save [Control]-[S] saves the current output format in a .PRT file. Clear [Control]-[C] deletes the current output format, and remains in Output mode. Load [Control]-[L] reads in a saved output format. Quit [Control]-[Q] exits InfoBaseST.

Select an option under the Output menu to generate the actual output. You can direct it to the printer, screen or disk. The printer and disk options prompt you for the number of repetitions, which can be any number from 1 to 999. This is useful for printing multiple address labels. Reports saved to disk have a .TXT extender.

The screen option prints only once. Use [Control]-[S] to stop scrolling and [Control]-[Q] to resume. The display wraps if WIDE has been chosen.

Many Thanks
I would like to express my sincere gratitude to two ST users who acted as beta testers for InfoBaseST. Without the input of Rob Gallau and Rod Falanga, InfoBaseST would be a lesser program. I also wish to thank Computer Works of Carmel, Ind. for testing a portion of InfoBaseST on a Mega 2 when a potential problem developed.

James W. Maki is a freelance programmer who works out of his home in Tacoma, Wash., much to the delight of his 2-year-old daughter, who needs him to fetch her crackers. He wrote VCR Organizer in the February 1989 issue of START.