The file QDISK.EXE contains the shareware version of the source disk for ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ÿÿÿÿÿÿ U S I N G F O X P R O 2 ÿÿÿÿÿÿ³Û ³ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ³Û ³ÿÿby Lisa C. Slater and Steven E. Arnottÿ³Û ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙÛ ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß Que Publishing ISBN 0-88022-703-6 (800) 428-5331 (For more information on purchasing the book, see the file QDISTRIB.TXT, which contains a list of phone numbers and distributors.) To un-compress QDISK.EXE, first create the directory you wish to have as its main directory, using the DOS MD command, move to that directory with the CD command, and copy the file QDISK.EXE to it. Then type: QDISK -D Once all the files are "exploded" onto the disk by this command, you can save space with this command: ERASE QDISK.EXE If you ever need to replace the files with a fresh copy of the sample files, put QDISK.EXE back in the main directory and type QDISK -D -O ... adding the -O switch if you wish to automatically overwrite existing files. This file contains all the code you need to create the model application described in the book, and quite a bit more. If you register for use of these programs, you will receive a disk with additional programs not required by the model database or its applications. The contents of both versions of the source disk are described below. You can register on CompuServe by providing the information below to: Steve Arnott 70247,2614 To register with MasterCard or Visa, please fill out the information requested below and the enclosed order form. If you wish to pay by check, your check must be drawn in U.S. dollars on a U.S. bank. Purchase orders not accepted. ÕÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͸ Õ¾ USING FOXPRO 2 REGISTRATION FORM ÔÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͸ ³ ³ ³ MasterCard _____ or Visa ______ Expiration Date _____________ ³ ³ ³ ³ Card Number __________________________________________________________ ³ ³ ³ ³ TO: FROM: ³ ³ Korenthal Associates Name: __________________________________ ³ ³ 230 West 13th Street ³ ³ New York, NY 10011 (Company): __________________________________ ³ ³ ³ ³ 212-242-1790 Voice (Title): __________________________________ ³ ³ ³ ³ 212-242-2599 Fax Address: __________________________________ ³ ³ ³ ³ Today's Date: City,State: __________________________________ ³ ³ Zip Code ³ ³ _________________ Country: _________________________ ³ ³ ³ ³ Phone Number: _________________________ ³ ³ ³ ³ Diskette format: 5.25"___ 3.5"___ ³ ³ ³ ³ Number of diskettes requested ³ ³ (includes domestic shipping and handling) ___ * US$ 15.00 _________ ³ ³ ³ ³ Please add $5.00 per pkg for overseas orders ___ * US$ 5.00 _________ ³ ³ ³ ³ New York residents add applicable sales tax. _________ ³ ³ ³ ³ Total enclosed _________ ³ ³ ³ ÔÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ; CONTENTS OF THE SOURCE DISK: \MODEL Directory The \MODEL directory contains the files created in the book that, together, form WIDGET.PJX, a model application. This application installs on the interactive system menu and can be used alongside some interactive commands. The additional files in WIDGET2.PJX take this application and make the simple adjustments required to use the Foundation READ, as explained in Chapter 14, as you would do to make your application the user's sole access to FoxPro commands. This is required for applications that use the Distribution Kit and is often preferable even for users of the Developer's Version. WIDGET2 follows the programming structure and recommendations of Chapter 14 and includes many of the suggestions for applications development in the later chapters of the book. You can learn more about it (and the way both WIDGET applications differ slightly from the code presented in the book) in \MODEL\WIDGBOUT.TXT -- either MODIFY the FILE directly or read it from WIDGET2's "About... " option. The \MODEL directory contains PRODUCT.APP, a slightly edited version of the FoxApp generated program that does data entry for the Product table created in Chapter 1. The editing, which provides data validation, is done in Chapter 12. Both WIDGET applications DO PRODUCT.APP instead of DO PRODUCT.SPR. The PRODUCT.PJX files (including both edited and unedited versions of PRODUCT.SCX) are stored in the \MODEL\PRODUCT directory. Both WIDGET applications use a screen, GETORDER.SCX, that is included in the FoxApp source files. If you re-build either project, you will have to locate this file for the Project Manager. If you didn't install the FoxApp source files (look under the \GOODIES directory) from your FP2 installation disks, you should remove the Set Order menu options from both WIDGET.MNX and WIDGET2.MNX. This will not materially affect either application. Along with all the WIDGET application files and data tables, the \MODEL directory contains these short programs and other files: þ CREATEV.PRG will create a MODEL.VUE file for your MODEL directory and drive, like the one created in Chapter 3. You can use this view file to set up your data files quickly while you're using the book. þ MODEL*.FRX, the sample report forms created in Chapters 9 and 10. MODEL.FRX is used in the sample applications. You can use the MODEL.VUE file when editing this report and MODELP.FRX but do *not* use it when editing MODELS.FRX (which has the same files open but in the opposite relation); CLOSE DATA and Restore Environment from the MODELS Report Layout option. Then do the same thing when you go back to MODEL.FRX or MODELP.FRX. This is explained in Chapter 10. þ CLIENT.LBX, the final result of the label discussion in Chapter 9 and 10. You will have to open the CLIENT.DBF from the ORGANIZE FP2 sample application files yourself and then Save Environment from the Label options. If you do not have the ORGANIZE sample files installed on your disk, you can practice creating a similar label with any address.dbf you do have, as explained in the text. þ BROWSEB.PRG shows you how BROWSE can help you perform data entry with fairly sophisticated formatting and validation, as described in Chapters 3 and 8. This program was actually used while the book was written, to do the Budget table data entry. þ CREATET.PRG shows you how to set up the model databases' tables from scratch. This program is included in Appendix I. All the data tables are, however, included in the \MODEL directory, with the data shown in the appendix. One change has been made to the Budget table data: many of their dates (Period field) have been made later and the Final field has been set to .F. for all of them. This ensures that more of the current records will be editable, since BUDGET.SCX automatically Finalizes records whose Period is current or past as it runs. þ W_USER.DBF is a resource file for the applications. It contains some read-only PREFERENCE records, including one which allows the BUDGET.SCX "driver" BROWSE to have specific dimensions without affecting BROWSE LAST defaults. See WIDGET2's errorlog-viewing procedure, under the Utilities pad on the menu, for use of other BROWSE PREFERENCES. \QUERIES Directory Contains all the sample queries used in Chapters 5, 6, and 7. A few of these .QPR files include additional comments or a second method suggested. Most of these queries can be run using the Widget files or the files from the FP2 sample applications, as described in the book. \KEYS Directory -- included on the registered disk only This directory includes KEYS.DBF and KEYS.FRX, which were used to provide the key code and use information presented as Appendix F. KEYS.FRX provided Appendix F as camera-ready copy for the book, using the FoxPro 2 PostScript printer driver. This copy of KEYS.FRX is set up for generic compressed fixed-pitch type. KEYS2.FRX is an alternative version for printing with shading under every second record. KEYNAME.PRG is a simple UDF used in both reports. KEYS.DBF provides a wealth of information about keys in FoxPro, including ascii values, inkey/lastkey, readkey update/noupdate, proper key labels for use in macros, KEYBOARDing, and ON KEY LABEL commands as described in Appendix F. We wanted to indicate that a capability or code is "Not Applicable" for a particular key by using a blank in the resulting report. To distinguish between "N/A" and a true 0 value, the numeric fields are filled by the number 999 where they should be shown as blank in reports. The FpNotes memo field provides additional information about a key's special uses in the FoxPro interface, including all "conditional" menu pads' shortcuts and editing capabilities. \MISC Directory -- included on the registered disk only This directory holds code for routines that are presented in the book but don't directly support the model applications. Files include: þ RANDOM.PRG, not included in the book, will give you a method to fill a table with random sample data -- helpful if you want to test Rushmore optimization or other FoxPro techniques on large tables. Use RANDOM.PRG with the APPEND FROM trick described in Chapter 7 to create *really* large tables! þ STARTOFF.PRG comes from Appendix I. This is a solution to the problems of how to start up a READ in the included BROWSE, and how to deal with the fact that that child windows cannot be used with a READ CYCLE. This program has been slightly improved over the version printed in the book. þ UNALIAS.PRG is a sample of a type of procedure referred to in Chapter 13, to remove alias information in a screen or report form. This is especially important in report forms that are destined for use in queries, as explained in Chapter 7. It is reproduced from Appendix I. þ USECAL.PRG demonstrates calling a desk accessory in a VALID using a nested MODAL READ. This program is found in Chapter 15. USECAL2.PRG is an alternative, calling the desk accessory menu option using PLAY MACRO. It is less flexible but easier to adapt. Additional short procedures included from Chapter 15: PASTECLC.PRG (bring the value of the calculator into the current GET, testing for GET TYPE(), on a hotkey or menu shortcut press), CAPSCRN.PRG (append CAPTUREd screens to a file as part of documentation procedures), LOOKHELP.PRG (look up the word currently under the cursor in the current help file). þ PDCHECK.PRG is not directly discussed in Chapter 15, but is included to support the discussion of printer drivers there. This program gives additional information to that obtained in the error logging procedures in WIDGET2, specific to printer driver setups. þ CHECKPRO.PRG was used while WIDGET.APP and WIDGET2.APP were being prepared. It's a simple example showing you how you can USE project files (PJXs) like any other table, in this case to provide a comparison between them. It generates the COMPWIDG.TXT file you'll find in the \MODEL directory. You'll want to create similar programs to figure out what needs to be zip'd for distribution, what needs backing up, etc. þ USE_LIB.PRG contains the procedures detailed in Chapter 15's section on using the API and libraries. The library used as an example was fictitious, but these procedures demonstrate standard library handling. þ CHAP_17.PRG contains listings of both the code fragments and complete procedures used in Chapter 17 to illustrate advanced programming techniques. Included are demonstrations of environment saving and restoring, the low level file functions, key handling, password protection, data conversion to and from different formats, dynamic window sizing and user-controlled report printing procedures. þ INSTALL.PRG, from Chapter 20, which provides installation procedures and conditional CONFIG.SYS editing using the low level file functions. Also included from Chapter 20 are MAXLINE.PRG and CONVERT.PRG, which demonstrate other uses of the low level file functions, and the array- handling procedures from the first half of the chapter (as 20_ARRAY.PRG). þ PRT_HELP.PRG contains a simple procedure you could use to allow users to print items from the helpfile; it comes from Chapter 18. Most of the ideas in Chapter 18 with regard to custom help files and error trapping and logging in applications are implemented in WIDGET2. þ RUNTIME.PRG converts the information sent by the FPUTS() command in the Debug window to a DBF format for further evaluation, as shown in Appendix C as part of performance optimizing procedures. \PHDBASE Directory -- included on the registered disk only This is a fully functional "end-user" version of PhDbase, a FoxPro library from Korenthal Associates. PhDbase is a new search technology that finds misspelled names in seconds, even with the largest databases, combining the speed of Soundex with the accuracy of traditional fuzzy searches. This application demonstrates an effective use of third-party libraries and FoxPro 2's API to extend the language. This application also illustrates the creation of a "developer's tool" in FoxPro 2; it installs itself on the System menu, where you can use it to search any database table interactively. Its design integrates the menuing contructs, Rushmore optimization, the BROWSE command, and structural indexes, in a unique display of the flexibility of the FoxPro environment. For information on purchasing the Developer's Edition of PhDbase, so you can SET LIBRARY TO its functions in your own applications, contact Korenthal Associates directly. Although the end-user application included here is FoxPro 2-specific, PhDbase is available for Clipper and dBASE as well as FoxPro. PHDBASE.EXE is a self-extracting compressed file. Follow the procedures above for QDISK.EXE, to "explode" PHDBASE into its component files.