CHANGES FROM dBASE III PLUS TO dBASE IV FOR PC'S By Marilyn Rice, University of North Texas Academic Computing Services Microcomputer Support Consultant, "Benchmarks," April/May 1990, Volume 11, Number 3. Remember trying to use dBASE III Plus without any or some basic knowledge of databases, only to become confused and discouraged? The enhancements from dBASE III Plus to dBASE IV now provide power for a first-time user as well as application developers. The following discussion highlights many of the basic differences between dBASE III Plus and dBASE IV general working environment. NEW USER INTERFACE A completely new interface allows you to harness dBASE IV's features and power without needing to write statements at the dot prompt. The dBASE III Plus Assistant has been replaced by the far more sophisticated Control Center, which makes it easier to work with all the essential database components. dBASE IV has easy to understand instructions and can simply create pull down menus. The Control Center The Control Center is your base of operations, the gateway to every other part of the dBASE IV program allowing you to open and close files, and access the menu system to establish views, reach design screens, run programs and manage files and other catalogs. The Control Center is comprised of four main parts: A Menu Bar, Catalog Name, Control Center panels, and a Message and Navigation Line. The Menu Bar is located at the top left-hand corner. The Menu Bar has three pull down menus: Catalog, Tools, and Exit. When opened, the menus provide a rich array of data handling capabilities. Directly under the Menu Bar in the center of the screen is the Catalog name. Catalogs allow the organization of files together in task-related groups. The Catalog name tells which catalog file group you are working with. Located in the middle of the screen are the Control panels that display the six types of files: Data, Queries, Forms, Reports, Labels, and Applications programs. At the bottom of the Control Center, the Navigation Line and the Message Line show available keyboard options for working with the files and data. The Control Center also has some features not available from the dot prompt, such as a tree-structured DOS file directory and manager. dBASE IV also now honors the DOS read-only file attributes. Database Files Changes to database files make dBASE IV more powerful and efficient than dBASE III Plus. The database structures have been increased to contain up to 255 fields per record. In addition, each field may now optionally be designated as a key field on which the database is indexed. dBASE IV database structures may also contain a new numeric data type, F, that indicates a field containing floating point numbers. In addition to the above changes, a single file can now be related to more than one file simultaneously. For example, a database file can be related to a query file and a report file at the same time, known as multiple-child, multiple-file relationships. Browse and Edit In dBASE IV, the Browse and Edit screens have been linked together to be used from the F2 DATA key to toggle between a table (Browse) and form (Edit) displays of information. Again, for each screen, easy to use and understand pull down menus are available. Also, dBASE IV has a more powerful editor than dBASE III Plus for editing memo fields and programs. In addition, memo fields can now contain up to 64K of text. Error Handling This error handling feature has been greatly improved from dBASE III Plus to dBASE IV. When an error occurs at the dot prompt, you may now select options to edit the command line, get help, or cancel the command. Help System The Help system is far more powerful than before. dBASE IV has an on-line, context-sensitive help feature you can activate any time. To get to the Help menu, Press the F1 Help key and a Help box appears in the middle of the screen with a menu bar. You will then see at the bottom of the Help menu box, several menu options available for increased functionality. The options are: * CONTENTS: Provides a nested Table of Contents of help topics. * RELATED TOPICS: Displays a list of relevant help screens for various related topics. * BACKUP: Allows backing up one screen at a time through selected help screens. * PRINT: Prints the displayed Help screen directly to a printer. Queries and Views In dBASE IV, you create view queries on a new work surface, the query design screen which you can reach from the Control Center by selecting in the Query panel. You can also select a data file and press Shift-F2. You can now join files, filter their records and choose which fields to display using the "file skeleton" (blocks representing database fields) onto the query design screen. You can also create calculated fields and global filters for any query. Forms The screen painter has been greatly improved. You can lay down all the fields and field names at once with an automatic layout. You can assign colors to design elements or draw crisp lines and boxes around your forms. You will also find it easier to move fields, boxes and copy text to other places on the form. Calculated fields are available and you have more picture and template characters to chose from. Labels You no longer have to enter dBASE expressions for each line of the label. Instead, labels use a layout surface and you place fields where you want them to appear on a label. Fields can be added from the database file or query view. The labels generator offers support of an automatic setup for nine of the most common label sizes. Reports The Reports layout surface has been completely redesigned. You now use a WYSIWYG (What You See Is What You Get) layout screen that is divided into several report bands. Each band represents either a specific grouping of records, or a special band such as a report introduction or summary. Indexing dBASE IV uses a new method of indexing that is able to maintain up to 47 index tags in a single file called an .mdx (multiple index) file. Each index tag is similar to an old .ndx file, and consists of a tag name and key expression. The basic difference is that up to 47 different index expressions (the equivalent of 47 old .ndx files) can be maintained in a single .mdx file. You can create the index using the pull down menus or, if preferred, at the dot prompt. For example, consider a customer database in which you needed three different indexes. In dBASE III PLUS, you would create the indexes from the dot prompt as follows: USE Customer INDEX ON Cust_nbr TO Custnbr INDEX ON SUBSTR(Last_ name,1,8)+SUBSTR(First_ name,1,1) TO Custname INDEX ON Zip_code+SUBSTR(Last_name,1,8) TO Custzip Using the production .mdx file in dBASE IV, you would need the following similar commands: USE Customer INDEX ON Cust_nbr TAG Custnbr INDEX ON SUBSTR(Last_ name,1,8)+SUBSTR(FIrst_name,1,1) TAG Custname INDEX ON Zip_code+SUBSTR(Last_name,1,8) TAG Custzip Also, dBASE IV maintains complete compatibility with dBASE III PLUS .ndx files. and dBASE IV allows up to 10 of any kind of index files (.mdx or .ndx) plus the production .mdx files to be open simultaneously per database file. NEW COMMANDS AND FUNCTIONS For the experienced dBASE applications user, dBASE IV has many new commands and functions that make it far more efficient and powerful to use than any previous versions of dBASE. The following list doesn't cover all the functions, just an overview. For a complete listing of commands and functions, consult your dBASE IV Language Reference Manual. The enhanced functions are: * BOF( ) * LOOKUP( ) * CHANGE( ) * LUPDATE( ) * DBF( ) * MDX( ) * DELETED( ) * NDX( ) * EOF( ) * RECCOUNT( ) * FIELD( ) * RECNO( ) * FLOCK( ) * RECSIZE( ) * FOUND( ) * RLOCK( ) * ISMARKED( ) * SEEK( ) * KEY( ) * TAG( ) * LOCK( ) The enhanced commands are: * DISPLAY STRUCTURE * SKIP * GO/GOTO * UNLOCK * LIST STRUCTURE * USE * RESET In addition to these commands, dBASE IV has added commands and functions for calculating financial, mathematical and statistical information. The CALCULATE command can process and evaluate any of these functions in a single pass throughout the database. For example: In dBASE III PLUS: USE customer COUNT TO Nbr_Custs SUM Total_Dol TO Amt_Spent Now is used in dBASE IV: USE customer CALCULATE CNT(), SUM (Total_Dol) TO Nbr_Custs, Amt_Spent See the Language Reference Manual for full information on the financial and statistical capabilities of the CALCULATE command. For handling financial functions, dBASE IV has a few functions added to make it easier to calculate future values, present values, payments and other financial information. The financial functions are: * FV( ) * PAYMENT( ) * PV( ) To compute complex calculations, several mathematical and trigonometric functions have been added to dBASE IV. The new mathematical and trigonometric functions are: * SIN( ) * RTOD( ) * ASIN( ) * DTOR( ) * COS( ) * SIGN( ) * ACOS( ) * CEILING( ) * TAN( ) * FLOOR( ) * ATAN( ) * LOG10( ) * ATN2( ) * RAND( ) * PI( ) Statistical capability has been added to dBASE IV with the ability to easily calculate standard deviations variances, minimums, maximums, averages, sums and counts of database records in one pass through the CALCULATE command. Again, please consult the section in the Language Reference Manual for more information on all the above functions, as these are just an overview of what is available. SUMMARY As you can see, dBASE IV has changed considerably from dBASE III PLUS. On the other hand, almost all dBASE III Plus applications will run under dBASE IV withoug modification. REFERENCES Ashton-Tate Corporation, "dBASE IV Change Summary" September 1988. Rice, Marilyn, "Introduction to dBASE IV" University of North Texas Computing Center Short Course handout, February 1990. Ashton-Tate and the Ashton-Tate logo, dBASE, dBASE III PLUS, and dBASE IV are trademarks of Ashton-Tate Corporation. ************************************************************* CCNEWS Copyright Notice If you use this article, in whole or in part, in printed or electronic form, you are legally and morally obligated to credit the author and the original publication name, date, and page(s). We suggest that you also inform the author of your intention to use this article, in case there are updates or corrections that he or she might wish to suggest. The ideas and opinions expressed in this article, as well as articles obtained through CCNEWS and the CCNEWS Articles Archive, do not necessarily reflect those of EDUCOM. EDUCOM will not accept responsibility for misinformation, nor will EDUCOM be responsible for misuse of information obtained through the CCNEWS Articles Archive. If space and format permit, we would appreciate your crediting the "Articles database of CCNEWS, the Electronic Forum for Campus Computing Newsletter Editors, a BITNET-based service of EDUCOM." We would also appreciate your informing us (via e-mail to CCNEWS@EDUCOM) when you use an article, so we will know which articles have proven most useful. *************************************************************