HyperBase (c) 1987 by General Design P.O. Box 2352 West Lafayette, IN 47906 Programming Team Michael MacKenzie Marc Mengel Craig Norborg Using HyperBase Main Menu Options PART ONE - FILE OPTION New: This allows you to start a new datafile using the current format file that is displayed on the format file status line. Open: The open option allows you to open up a new format file, printer format file, or sort index. The sub menu attached to open contains either: Database: Which allows you to open either just a new datafile or a new datafile and all the default files with it; or Format: Which allows you to open a new format file for the screen. BEWARE! There is no check to see that the format file "fits" the data file, so be sure you are opening a valid format for the current database! Printer: This allows you to read in a new printer format for the current database. Also beware on this to have a valid format for the current data. The printer format will first load a ".prt" file associated with the name typed in and if one is not available, it will load a ".fmt" file instead. Index: This option allows you to read in a previously made sort index for this datafile. Be very careful to read in a valid sort index for this datafile, or you will have unpredictable results! When one of the Open options is chosen, a request will be put on the screen allowing the user to chose the file of his choice. If the user has chosen the Database sub-option, he will be prompted to open either the datafile only or all the files associated with a datafile. What this means is that if you open up the datafile named "foo", that you could just open this datafile, or open "foo", "foo.fmt" (the format file), and "foo.ind" (the sort index). Print: This option is to print out the entire database, in the current sort order, using the current printer layout. Cleanup: This option will really delete all records previously flagged as being deleted. The old version of the database is left on the disk under the name datafile.bak, so if you don't have enough disk space for another copy of the database, it would be best to get rid of any un-needed files so you have enough room to perform this operation. PART TWO - SORT OPTIONS Sort: This option allows the user to sort his datafiles. As of this release, the user must input the field numbers by which he wants to sort on. For example, if the name field was field number 1, and the state field was field number 2, and you wanted to sort by state, and then name (for all states that were the same) you would type in 2 [ret] 1 [ret] then by a "." to indicate that you are finished. One thing we should mention to the user is that if you wish to improve the speed in which the database sorts, we have provided an adjustable internal buffer for your convenience. As of this release, it is controlled by the third command line argument and defaults to a size of 20. What this would mean is that if your datafile was less than 20 records long, it would sort it all in RAM (which is faster). By setting this to a larger value for larger datafiles, you can greatly improve the speed of sorting on these datafiles. For an example, if you had a datafile of 800 names for a mailing list called "mail" and you wanted to make the buffer size be 1/4 of the file size, you would type in: "hyperbase mail 200" and this would invoke hyperbase with the datafile called "mail" with a buffer size of 200! Save Index: This option allows the user to save the previously created sort index. You will be asked a file name for the sort index to be put under and a ".ind" will be appended to the file name so it is easily identifiable as a sort index. PART THREE - SEARCH OPTIONS Search: The search option is used to search for a record, or a set of records. The way this is done is, after you select the search option, a screen with a blank datafile format appears on the screen. You then go to as many fields as you wish and use the backwards arrow (<-) to position your cursor in the position BEFORE the field you wish to search for. In this one-character field, you may input one of: ">" Greater Than "<" Less than "=" Equal to "!" Not equal to and search according to whatever you then type into the field. By leaving a field blank, it will default to every record being a match. Display: Screen: This will bring the database up in a "browse" type mode on the screen where you can look at the found records one by one. Printer: This will print out the results of your search using the current printer format. If no printer format was specified, the current screen format will be used. Delete Found: This is a very useful option, which will allow you to delete all records that were found in the last search. Delete not Found: This option is very much like the last one, but allows you to delete all records not found in the last search. Search for Deleted: This option searches for records that are marked as deleted, but haven't actually been removed by the Cleanup facility. After doing this, you can go into your datafile using the Browse option and undelete records just like you delete records. PART FOUR - BROWSE OPTIONS View: This command will put you in "view" mode where you will be able to look at your datafile, but not change any of the data fields within it. Insert: This command allows you to go into your datafile and change data or add new data. It looks like "view" mode, but allows one to change data. The database inserts records in sorted order. This means that if you have specified a sort order for this database, new records will be inserted in sorted order, and the current record number may change. Using HyperBase Browse Menu Options PART ONE - FILE OPTIONS Save: This option allows the user to save the changes made while in a browse mode. Redraw: This option is for redrawing a screen that may have become corrupted in some manner. Quit: This option allows the user to quit and not save any changes made to the database in the current editing session. PART TWO - EDIT OPTIONS Kill Field: This option allow you to easily kill all text/numbers in an entire field in one keystroke. Delete: This option allows the user to mark a record as deleted. NOTE: This option only flags the record as deleted in the datafile, to actually delete the record, one must use the "cleanup" option from the main menu. UnDelete: This option is a special option that only shows up when in undelete record mode from the main menu. It takes the place of delete in the menu structure, and will allow a user to "undelete" a record by resetting the delete flag. Once the "Cleanup" option is used, undeleting records previously deleted will not work! PART THREE - BROWSE OPTIONS The browse options allow the user to go forward and backward through the database. Browsing through a database depends on the sort order to find its records and it will be necessary to have a sort index loaded or use the Sort option from the main menu before browsing through the datafile. Forward: This option allows the user to go forward one record in the database according to the current sort order. Back: This option allows the user to go back one record in the database according to the current sort order. Goto: This option prompts the user for a record number to go to and proceeds to go to that record. If the record number input is greater than the amount of records, it will go to the last record in the database. Negative record numbers will not be permitted. Format File Options Valid operators for for use in a formula are: + - Addition - - Subtraction * - Multiplication / - Division & - String Catenation [] - SubString Operations Valid characters for building an input format are: # - Allows input of one numeric character. _ - Allows input of one alphanumeric character. (Underbar) ^ - Makes the user type return, tab, or right arrow to go onto the next field. This is only valid at the end of a field. It prevents the user from accidentally typing into the next field. Any other alphanumeric character in an input format is taken to be a literal character that shows up in a field. For example, the dashes in a telephone number, or the dash in a zip code, etc. If such a character is put in the field, it will be skipped over during input, it will not show up in the datafile, and the user will not allowed to type on it. If you wish to put a comma, quote or backslash as a literal character in a format, you must put a backslash before this character. Each line of a format file consists of: 1) A Label 2) A Row Number 3) A Column Number 4) A Page Number (currently unimplemented, use 1) 5) An Output Format (used only with formulas) 6) A Formula (optional) 7) An Input Format (optional) Each is followed by a comma. For example: Label, 1, 1, 1, $###, {1} + {2}, ______, defines a format which prints the label "Label" at row 1, column 1, on page number 1. It allows the input of 6 alphanumeric characters, adds fields 1 and 2 and outputs a $ followed by the first three characters of the result. The row, column, and page fields must be filled in. The label can be empty, but must still have the comma. This is the same with the output format, formula and the input format. ,10,20,1, , , , produces a field at row 10, column 20, page 1 which has no label, output format, formula, or input format. (essentially a blank line) There are also sub-string and catenation operations in HyperBase that will allow you to take apart and re-assemble strings. To get part of a string, put a pair of brackets after a string designator and put either one number or a pair of numbers separated by a comma. A string designator is anything that represents a string. You can catenate two strings and take a substring of the resulting string or any combination of catenations and substrings. One thing you must make sure to do is to parenthesis your string catenations so the substring operator knows which string to take a substring of. For example: ({1} & {2})[10,20] will take fields 1 and 2, catenate them together, and then pull out the tenth through twentieth characters of the result. That is, if field 1 is "abcdfghijklmn" and field 2 is "ABCDEFGH", the above formula would result in "klmnABCDEF" To take a single character out of a string, you only put one number in the brackets. For example: {22}[13] will take the 13th character in field 22 and return this. Printer Format Files: The printing format file is identical to the screen format file, except for that all of its formulas are based on the current screen field numbers. Feel free to use them interchangeably, although a special printer format file may sometimes be necessary. If you wish to put in a form feed in the printer format file to start each record on a page of its own, you should create a field with a label of cntl-L. Use this same method to send other control characters to your printer for things such as underlining, etc. The screen format is used as the printer format by default. Tutorial In this tutorial section, we will show you, step by step, how to create a database for a mailing list, and how to put it in practical use. Even though all of the mailing list files discussed in this tutorial are on the disk, we urge you to go into your favorite editor and at least look at the files! STEP 1 The first thing that you must decide is what data you want to keep track of in this mailing list. A couple of things you would want to put in a mailing list would be: First Name Last Name Address City State Zip Code Telephone STEP 2 You must decide how big each field should be. Let's say we decide on the following sizes: First Name 15 characters Last Name 15 " Address 25 " City 25 " State 2 " Zip Code 9 digits Telephone 10 digits Now that you have decided on the size of each field, you must also determine the layout of the record for the screen. For example, you could decide to have both the first and last names on the first line, the Address on the third line by itself, and the Address, City, and State on the fith line, with the Zip Code on the seventh line, underneath the State, and the telephone number beneath that. You may also decide to put dashes in the proper places on the Zip Code and the Telephone number, something like: 01234567890123456789012345678901234567890123456789012345678901234567 First Name: _______________ Last Name: _______________ Address: _________________________ City: _________________________ State: __ Zip Code: #####-#### Telephone Number: (###) ###-#### STEP 3 From this, you can build your format file. Consider each portion of a line in a format file. Each line of a format file consists of: 1) A Label 2) A Row Number 3) A Column Number 4) A Page Number (currently unimplemented, use 1) 5) An Output Format (used only with formulas) 6) A Formula (optional) 7) An Input Format (optional) The fields of the format file are separated by commas. In our example, the first name field of our mailing list would be: First Name, 1, 1, 1, , , _______________, This says that the field "First Name" is in row 1, column 1 on page 1; there is no special output format or formula, and that the input is 15 alphanumeric characters. Now, if we just go ahead and interpret the rest of our mailing list, we can make our own format file. It will look something like this: First Name,1,1,1,,,---------------,-------------------------, City,5,1,1,,,------------------------, State, 5, 40, 1, , , --, Zip Code, 7, 1, 1, , ,#####-####, Telephone Number, 9, 1, 1, , , (###) ###-####, STEP 4 Since HyperBase thinks that all format files end in a ".fmt", call this file "mail.fmt" when saving it. Now, since one of the objectives in having a mailing list was to print mailing labels, you may want to design a format that will be the mailing label itself to be used as the printer format file. On a mailing label you would want to put: 1) The first and last name joined together. 2) The address. 3) The city, state, and zip code. Ignore all of the other fields since there is no need for them on the mailing label. The physical size of the mailing label is 6 lines of text, and you want one line above the information on the label, and one line below. This makes a four line mailing label, which looks something like First and Last Name Address City, State Zip Code Once again, we can take this one step further and build a format file from this. It would look something like this: , 2, 1, 1, ------------------------------,{1} & " " & {2}, , , 3, 1, 1, ------------------------------, {3}, , , 4, 1, 1, ------------------------------, {4} & "\, " & {5}, , , 5, 25, 1, #####-####, {6}, , , 6, 1, 1, , , , These different formats say that on line 2, column 1 there is a string of 30 characters to print out that is the concatenation of fields 1 and 2. They then say that on line 3, column 1, there is another string of 30 characters that is the same as field 3 in the datafile. The third line in the format file says that there is on line 4, column 1, a string of 30 characters made up of field 4 (City) followed by a comma and a space and then field 5 (State). The fourth line just says that on line 4, column 25, that the 6th field (Zip Code) should be printed out. The fifth line just says print a blank line for line 6. You have just finished a quick tutorial on getting started using HyperBase. You should now be able to insert records into your newly formed mailing list and even print out mailing labels using either the print entire database option or print selected records using the print search results option. Formats for HyperBase Files In HyperBase, there are 3 different types of files. There is the format file, which has been discussed earlier, the sort index file, and the data file. The data file itself is one of the more flexible features of HyperBase. In the design of HyperBase, we all looked back on our experiences with databases and decided that one of the more useful options that we would have liked other databases to have, is to have an easily readable datafile. We thought that if the datafile was readable, it would be much easier for the user to relate to the datafile, and much easier to fix corrupted datafiles. In a datafile, the first thing on each line is a flag character which marks a record as present or deleted. If you have just opened a new datafile or used "CleanUp" there will be no records marked deleted. The deleted flag gets set every time you delete a record, or make changes to it. When you change a record, HyperBase flags the current copy as deleted and appends a new record with the updated information at the bottom of the file. This makes it very simple to recover from mistakes. Following the flag character the fields of your data format are enclosed in quotes and separated by commas. For example, if you had a record from the mailing list used in the tutorial, it could look something like this: "H","Craig","Norborg","539 N Grant Street","West Lafayette","IN","47904", The "H" in quotes at the beginning of the line tells me that the record is not deleted, if a "D" were there, it would be flagged as deleted. Feel free to go in with your favorite editor and edit your datafiles if you prefer this method, it will not affect the database as long as you don't mess up the quotes or commas. However this will invalidate the index file, which must be rebuilt using the "Sort" option from the main menu. You should also feel free to write your own programs to work with the datafile. The index file is more complex than the datafile and is not in human readable form. The index file format is liable to change between releases. HyperBase Quick Reference Sheet ------------------------------- HyperBase Main Menu ------------------- Command Key Equiv Command Key Equiv New A-n Print A-p Cleanup A-c Quit A-q View A-v Insert A-i Search A-s Display(Screen) A-d Display(Printer) A-r Delete Found A-f Delete Not Found A-! Sort(Order) A-o Save Sort Index A-x HyperBase Browse Menu --------------------- Command Key Equiv Command Key Equiv Redraw A-r Save A-s Quit A-q Kill Field A-k Delete A-d Forward A-f Back A-b Goto A-g Invoking HyperBase ------------------ HyperBase DataFileName BufferSize Example: HyperBase Datafile 200 Special characters in files: Format Characters: _ AlphaNumeric Input Field \ Literal next character ^ Lock Field # Numeric Input Field , Separate Fields Formula Characters: + Addition - Subtraction & Catenate Strings / Division " Enclose literal strings * Multiplication [] Substring Operations HyperBase Copyright Notice: HyperBase is copyright 1987 by General Design. The binaries may be distributed free of charge by anyone to anyone. Special permission must be obtained to distribute HyperBase for a fee. ( This permission is extended to all non-profit User's Groups for the purpose of defraying copy & distribution costs) If you like HyperBase send $25.00 to: General Design P.O. Box 2352 West Lafayette, IN 47906 For your $25.00 you will recieve the latest binary, manual and examples. You will also be placed on our mailing list and will be notified of bug-fixes and new releases. If you think that $25.00 is too much or you don't like HyperBase send us a note telling why. HyperBase Sources: Hyperbase source is available for the Amiga(tm) personal computer. It was written in Manx Aztec(tm) C. We offer single user, site and distribution licenses for a small fee. We also offer educational discounts. Write us at: General Design P.O. Box 2352 West Lafayette, IN 47906