Help Topics |
|
The Grocery List Database terminal program provides the user with an easy to use menu driven interface consisting of one main menu and several sub-menus:
------- GROCERY LIST PROGRAM'S MAIN MENU ------- (0) - Exit this program (1) - Add, Remove, or Change items in the database (2) - Find items in the database (3) - Display items in the database (4) - File Operations Press the number of your selection
Press 0 to exit program.
Press 1 to go to the insertion/removal menu.
Press 2 to find objects in the database.
Press 3 to display objects in the database.
Press 4 for the file operations menu.
When the program is executed for the first time a new database file and index file will be created. The program will automatically open its associated data file and index file every time after that. The program configuration file is used to point the program to the location of the database and establish user access rights.
The path to the configuration file should be set by an environmental variable if the configuration file resides in a different directory then the executable. Under UNIX a copy of the configuration file can be placed in each users directory to create a custom profile. If you want to specify a specific database when the program starts type the program's name followed by the name of the database with no file extension: MyDbase mydbfile
The program's configuration file is used to load configurable parameters from a text file. You can use any text editor to modify the configuration file.
####################### #### Start of File #### ####################### # --------------------------------------------------------------- # User configuration file # --------------------------------------------------------------- # Set the path to this file in the environment or leave this file # in the program's working directory. # =============================================================== # Sales tax used to calculate grand totals. Adjust this value for # the current sales tax represented by percent, example: 6.8 # =============================================================== SalesTax=6 # =============================================================== # =============================================================== # Database file to open when application starts # =============================================================== # Do not use any file extensions when creating or opening file. # Both data and index will share the same name with different # file extensions. The data file will have a .pod extension and # the index file will have a .btx extension. # =============================================================== # Database file to open when application starts DBFileName=..\db_files\grocery # =============================================================== # =============================================================== # Enable/Disable Admin user privileges # =============================================================== # Valid entries are FALSE the disable or TRUE to enable. If # enabled the user will be allowed to add, change, or delete # entries. Will default to FALSE if no valid entry is found. # =============================================================== AdminUser=TRUE # =============================================================== # PostScript Setup # =============================================================== # Maximum string length for each cell CellLength=19 # Font size for the item bar and the cells FontSize=7 # Page orientation: LANDSCAPE or PORTRAIT Orientation=PORTRAIT # Paper size: LETTER, LEGAL, TABLOID, A3, or A4 PaperSize=LETTER # Font types: COURIER, COURIER_BOLD, COURIER_OBLIQUE, or COURIER_BOLD_OBLIQUE ItemBarFont=COURIER_BOLD_OBLIQUE CellFont=COURIER # =============================================================== # --------------------------------------------------------------- ##################### #### End of File #### #####################
The program will search for its configuration file in its working directory and then search the environment. If the program cannot find its configuration file or a configuration file does not exist, it will substitute the configurable parameters with default values set within the source code.
There are two levels of access for the database, administrative access and a general access. Access levels are configured in the program's configuration file. If an access level is not specified the program will default to general access.
General Access:
General access grants you read-only privileges. You do not have the capability to modify the database with an add, change, delete, import, or merge operation. General access denies you the right to create new database files. If you try to create a new database with general access the program will flag you with a file creation exception and terminate.
Administrative Rights:
Administrative access grants you read and write privileges. You will be allowed to modify the database, assuming that you have read and write privileges to the actual database files. If you give yourself ADMIN privileges and do not have read and write access to the database files the program will terminate. ADMIN privileges do not give you exclusive rights to the database.
Exclusive Rights:
Exclusive rights, means that your instance of this program is the only one running. If more then one version of this application is using this database, either over the network or on the same computer, you do not have exclusive access to the database. Any modifications made to the database without exclusive rights will flag the other users with an access violation. An access violation means that the database has been modified and your version is no longer valid. If you receive an access violation, exit the program and restart it.
The insertion and removal menu is used to add, change, or remove items in the database. NOTE: You must have exclusive rights to the database to perform any of these operations. See the Access Rights section.
--------- DATABASE INSERTION/REMOVAL MENU --------- (0) - Return to main menu (1) - Add items to the database (2) - Change an item in the database (3) - Remove an item from the database Press the number of your selection
Press 0 to return to the main menu.
Press 1 to add new objects to the database. The name of the object, entered in the first entry field, must be unique and can only be entered once. If the object already exists in the database the add function will flag you with an error. The database will support duplicate objects, but this feature was not implemented in this program.
Press 2 to change an object in the database (except the key member). If the object is found, it will be displayed with its key name disabled. You are allowed to change everything except the object's key name. The key name restriction is enforced to prevent duplicate names from appearing in the database. The database will support duplicate names, but this feature was not implemented in this program.
Press 3 to remove an object. When selected, you will be prompted to enter the object's key name. Enter the key name of the object you want to delete.
The Find menu is used to find objects in the database. A search can be performed on the object's key name or any of its associated string fields.
---------- DATABASE QUERY MENU ---------- (0) - Return to main menu (1) - Find objects by Item Name (2) - Find objects by Brand (3) - Find objects by Store Press the number of your selection
Two types of searches can be performed, a plain search or a wild card search. A plain search is not case sensitive, but it requires you to enter the complete string. The plain search will find a single match if searching by key name or will find every match of the complete string if searching on any of the other entry fields. After a plain search or wildcard search, you will be given the option to display the object(s) that matched the string. If no matches are found, the program will alert you with a message stating that no matches were found.
A wildcard search is performed by entering the wildcard character "*" anywhere in the string. Wildcard searches are case sensitive, but only require you to enter a piece of the string. The wild card search will find every occurrence of the string in the specified field.
---------- DATABASE DISPLAY MENU ---------- (0) - Return to main menu (1) - Display all items line by line (2) - Display all items one a time Press the number of your selection
Press 0 to return to the main menu.
Press 1 to display each object in the database line by line.
Press 2 to display each object in the database one by one.
---------- DATABASE FILE OPERATIONS MENU ---------- (0) - Return to main menu (1) - Display Variable Block Database statistics Press the number of your selection
Press 0 to return to the main menu.
Press 1 to display VBD file statistics for the data file and the index file. This information is used to analyze and troubleshoot VBD files. File statistics for both the data file and the index file will be displayed.