The following text will give you information about the software included on this disk. If you are having problems, check the section at the end of this document titled Troubleshooting. ADRSBOOK This is subdirectory includes files associated with the address book application. > adrsbook.pbl The complete address book application as it should look when you complete chapter 3. > adrsbook.db, adrsbook.log The database files associated with this address book solution. COLRPNTR Here you will find the Color Painter. > colrpntr.pbl The Color Painter is both a utility you can use and an example which shows the use of standard user objects (see \UO\VISUAL\STANDARD\SCRLBAR to see how the scrollbar standard user object is used here as a slider control). You can also steal the window (and the user object) and drop them into your applications to open whenever you need for the user to enter a color. Just use Open() (not OpenSheet(), since it is a response window...) and you will find the result in Message.DoubleParm when the window is closed (it does a CloseWithReturn()). You can make an executable version of this application and add it to your PowerScript PainterBar (see Chapter 18, "Making Yourself at Home: Customizing PowerBuilder" for more information on customizing your PainterBars) to allow you to mix colors visually as you write your code. When you click OK, the long associated with the color displayed is copied to the clipboard, ready for you to paste into your script. If you would rather it paste the code which makes the RGB() function call with the appropriate values, you will find it easy to modify. CORKY1, CORKY2, CORKY3, CORKY4 Corky is a complete example application which you can use to keep track of notes and appointments. You can also follow along in the example in Chapter 24, "The Multiple-Document Interface," and use it to learn all about MDI programming issues and how to deal with them. Each directory includes a corky.pbl which is the incremental solution for corky at four different stages as you move through the chapter. This allows you to check yourself as you go along and make sure you've got everything before moving to the next set of topics. GRAPH > grphtst.pbl This application is associated with Chapter 21, "Graphs." Here you will find an application which implements a window graph with an interface that allows you to enter some data and then choose a graph type. The graph is then built before your eyes. Use this application to experiment with different graph types to see which one will represent your data most effectively and as an example of how window graphs work. INSTANCE > instance.pbl This subdirectory contains an application which is used to explore how windows are opened and how window instances work. It is used in Chapter 24, "The Multiple Document Interface." MINDYS The files here are for use with Chapter 21, "Graphs." > mindys.db, mindys.log This database contains the tables necessary to work through all the exercises in the Mindy's Restaurant example. > restaur.txt, sales.txt These text files may be used to populate the restaurant and sales tables with fresh data by doing a Rows|Import... in the Data Manipulation painter. MSBXPNTR > msbxpntr.pbl The MessageBox Painter is a utility that allows you to visually design a message box by selecting options on a dialog and then previewing the final output. Then when it looks like what you want, click OK and the complete MessageBox() command is copied to the clipboard ready to be pasted into your script. This is also a good candidate for addition to your PowerScript PainterBar. OLE2 > ole2.pbl, chkup.doc, paymnt.doc, shots.doc This directory includes the PBL and Word documents you will need to run the application described in Chapter 26. It will not work unless you have Word 6 or 7 on your machine. OLE is a touchy thing and you may have to experiment some to get it to work correctly. If you are getting errors try launching Word 6 with no documents in it and have it minimized when running this. You shouldn't need to do that but with some configurations... PK, PK05, PK06, PK07, PK09, PK14, PK15, PK16, PK19 > pk.pbl The PeopleKeeper solutions provided with the book are divided into seperate subdirectories with the above listed names. Each subdirectory has the complete solution for the application as it should be at the end of the chapter of the same number. In addition, PK is the final solution. PK is also where you will find additional files needed throughout the development process of your own PeopleKeeper application, including the SQL to build your tables, the TXT files to populate them and the common.pbl library. You will have to specify common.pbl in the library search path for the PK solutions when they are used because the library search path is not held in the application object. It is in the PB.INI instead. There is now a CONTACT database included with PowerBuilder. This application will not work if you try to run it against this CONTACT database. Use the CONTACT database included with this book. PWRSCRPT These files are associated with the embedded SQL examples at the end of Chapter 9, "Programming in PowerScript." > pwrscrpt.db, pwrscrpt.log This is the database which holds the tables associated with the examples. All three tables are in the same database. > books.txt, emplyes.txt, lotdata.txt These are files which may be used to repopulate the database tables with fresh data. > script.pbl Contains the completed example from the code. When you are finished working though the book and creating your own, you can compare it to these to see how you did. RESOURCE > *.bmp, *.ico This directory contains a number if bitmap and icon files used throughout the book. Whenever you need a BMP or ICO, look here first. SQL > sql.db, sql.log This database is used extensively in Chapter 12, "Creating SQL Queries" and Chapter 13, "SQL Data Manipulation Commands." Connect to this database before beginning those chapters. After you are connected, you will do most of your work in the Database Administration painter. UO All of the objects here are intended to provide examples of user object techniques and how different user objects work. Chapter 20, "User Objects: Making Your Own Controls" covers this topic. UO\VISUAL\CUSTOM > okcancel.pbl A simple example taken from the book which demonstrates how individual control events, which are normally lost in a custom user object, may be restored using user-defined custom events. UO\VISUAL\STANDARD\DW > suodw.pbl Probably the single biggest productivity boost you can give to yourself and your fellow developers is a standard user object based on the DataWindow control. I offer this simple object to get you started encapsulating tedious DataWindow functionality in one place so that it is not repeated again and again, and so that it can easily be maintained in one place. Examine the object in the user object painter. Then try it out. See how it works for you. How could it be made better? UO\VISUAL\STANDARD\SCRLBAR > scrlbar.pbl In Chapter 6, "Building a Window," I described how the scroll bars work in PowerBuilder. And I tell you how to make use of them as a slider for entering numeric information. The code presented there is encapsulated into a user object and then the user object is placed in a window which requests a percentage from the user. This user object is also used in the Color Painter discussed above. UO\CLASS\CUSTOM > stack.pbl Another example taken from the text. This is an object- oriented implementation of a stack using PowerBuilder's non-visual user object. It demonstrates the need for private data structures, the use of methods to control access to data and the way custom class user objects can be used in your application code. UO\CLASS\STANDARD > newsqlca.pbl Yet another example from the text. This is a user object that was inherited from the standard Transaction object and enhanced. There is also a small application demonstrating its use. Troubleshooting If you run into problems, below are listed some tips and guidelines. The PeopleKeeper application will not run unless you first connect to the contact.db database in PowerBuilder. This is because PeopleKeeper looks in the PB.INI file for its database information. For instructions on how to connect to a different database, see Appendex F, "The Disk". For instructions on how to make one of the applications on disk the current application in PowerBuilder, see Appendix F, "The Disk". When trying to connect to a new database, either in the development environment or when you first run an application, you may sometimes get a dialog titled "Connect to WATCOM SQL" with two edits labeled User ID and Password. This happens because the user ID and password were not specified in the database profile when it was created. All Watcom/Sybase SQL Anywhere databases have the default User ID: DBA. And the defualt password: SQL. Type these in at this dialog and you will be connected. When you run an application, you may see a dialog titled "DataWindow Error" with text something like this: Select error: SQLSTATE = S0002 [WATCOM][ODBC Driver][WATCOM SQL]Table or view not found:table 'tablename' not found The text tablename above will be the name of the table the application was looking for. If you get this or something like it, you will want to make sure you are connected to the right database in PowerBuilder. Most of the examples for this book pull their connection information from the PB.INI file. While this is convenient, it means that if you are not connected to the right database in PowerBuilder, the application won't be able to find the tables it needs. Remember, whatever database you had up last in the database painter is the current one, even if you don't have the database painter up anymore. See Appendix F for information about how to change the current database. If, in the course of running the PeopleKeeper application you get an error with this in the title bar: PowerBuilder Application Execution Error (R0007) And this in the body of the dialog: Application terminated. Error: Unresolvable external when linking reference at line 3 in clicked event of object cb_update of w_people. In the above text, you may very well have a different line number, event, object and window. This error might indicate that you have forgotten to make sure that common.pbl is in the library search path of the current PK application object. If you are running one of the incremental solution applications included with the book you may have to add common.pbl to the search path by hand. PowerBuilder forgets this information when going from one machine to another. If you are trying to connect to a database included with the book and see the following error... SQLSTATE = 08001 [WATCOM][ODBC Driver][WATCOM SQL]Unable to connect to database server: database engine not running You are probably running an old version of the Watcom database included with an earlier version of PowerBuilder. You will need to upgrade to the Watcom engine included with PowerBuilder 5.