Beruflich Dokumente
Kultur Dokumente
Ken Mayer
Second Edition
Table of Contents
Table of Contents
About the Author............................................................................. 1
Acknowledgments and Thanks...................................................... 3
Introduction...................................................................................... 5
Part I - Getting Started.................................................................... 7
Chapter 1 - Setup and Parts of the Environment.......................... 9
Speed Menus........................................................................................................................17
Getting Help..........................................................................................................................17
Using the Knowledgebase....................................................................................................19
Windows Vista................................................................................................... 19
Part II - Data................................................................................... 21
Chapter 2 - Table Types................................................................ 23
Field Properties.....................................................................................................................25
Null Values............................................................................................................................26
Field Names..........................................................................................................................27
Table Language Drivers........................................................................................................27
Indexes.................................................................................................................................28
Using BLOB Fields................................................................................................................30
DBF Table Limits...................................................................................................................30
Table of Contents
Creating a table.....................................................................................................................41
Add/Remove Fields...............................................................................................................41
Deleting a Table....................................................................................................................41
Renaming A Table.................................................................................................................42
Creating an Index Tag...........................................................................................................42
Deleting an Index Tag...........................................................................................................42
Adding Data to a Table..........................................................................................................42
Update a Set of Data............................................................................................................42
Database Aliases..................................................................................................................45
Dot Notation...................................................................................................... 59
Containership.................................................................................................... 60
Understanding the Object Inspector.................................................................. 60
Understanding Events....................................................................................... 61
Windows is Event-Driven......................................................................................................61
What is Event-Driven Programming?....................................................................................62
dBASE Events......................................................................................................................62
Using the dBASE Form To See How This Works..................................................................62
vi
Table of Contents
Event Handlers.....................................................................................................................63
Assigning Event Handlers.....................................................................................................63
Expression Codeblocks........................................................................................................65
Statement Codeblocks..........................................................................................................65
Using Codeblocks as Event Handlers...................................................................................66
Parts of a Class.....................................................................................................................66
The Class Declaration Statement.........................................................................................66
The Class Constructor Code.................................................................................................67
Class Declaration of Methods...............................................................................................68
The ENDCLASS Statement..................................................................................................69
Stock Classes.......................................................................................................................73
User-created Custom Classes..............................................................................................73
Building Custom Classes from Scratch.................................................................................73
General Syntax for Custom Classes.....................................................................................74
Object Containership......................................................................................... 81
An Overview...................................................................................................... 91
Creating and Coding Query Objects................................................................. 92
Rowset and Field Objects The Heart of the Data Object Structure................ 95
Table of Contents
Navigation In A Rowset.........................................................................................................99
Programmatically Stepping Through a Rowset...................................................................101
Editing Data In a Rowset....................................................................................................102
Deleting Rows.....................................................................................................................102
Field Class..........................................................................................................................103
Looping Through All Fields In A Table.................................................................................104
Other Field Object Events, Methods, etc............................................................................104
OLE, Binary and Memo Fields............................................................................................105
More on Expressions..........................................................................................................107
UpdateSet....................................................................................................... 143
Table of Contents
Implicit Locks......................................................................................................................168
Explicit Locks......................................................................................................................168
Using the Session Object to Modify Lock Behavior............................................................169
Locking the Rowset.............................................................................................................171
The _DBASELOCK Field....................................................................................................171
Maximum Locks..................................................................................................................172
CacheUpdates................................................................................................. 176
Working with Non-dBASE Tables.................................................................... 176
Transaction Processing.......................................................................................................176
Table of Contents
A Warning........................................................................................................ 189
The Form Designer......................................................................................... 189
The Inspector......................................................................................................................196
The Component Palette......................................................................................................199
The Field Palette.................................................................................................................201
The Format Toolbar.............................................................................................................202
Form Metrics.......................................................................................................................208
Add a Text Control..............................................................................................................209
Saving The Form................................................................................................................210
Modifying Properties of the Text Control.............................................................................210
Add a Pushbutton............................................................................................................... 211
Run the Form...................................................................................................................... 211
Add An Event Handler.........................................................................................................212
Modifying .wfm files.............................................................................................................213
Two-way Tools....................................................................................................................215
Table of Contents
Tabbox............................................................................................................. 279
Pushbutton...................................................................................................... 282
Line.................................................................................................................. 284
Rectangle........................................................................................................ 284
Image.............................................................................................................. 285
Shape.............................................................................................................. 285
TreeView and TreeItem................................................................................... 285
Progress.......................................................................................................... 291
ActiveX............................................................................................................ 293
ReportViewer................................................................................................... 298
SubForm.......................................................................................................... 301
xi
Table of Contents
Fonts...................................................................................................................................314
Colors..................................................................................................................................315
Other Grid Appearance Properties......................................................................................316
Multi-User?..........................................................................................................................335
Saving/Restoring More Properties Than Shown Here........................................................335
Event Sequences................................................................................................................343
The key() Event...................................................................................................................346
The onKey() Event..............................................................................................................346
The onChange() Event........................................................................................................347
Using the onLostFocus() Event to Force Navigation and/or Validation...............................347
The onMouseOver() and onMouseOut() Events.................................................................348
xii
Table of Contents
Source Code Aliases vs. Database Aliases, and Why Theyre Important....... 359
Chapter 17 - Using the Custom Classes that Ship with dBASE.... 397
Seeker.................................................................................................................................399
Splitter.................................................................................................................................401
Animate...............................................................................................................................405
Calendar.............................................................................................................................406
Form Viewer........................................................................................................................408
Creating Menus................................................................................................411
Edit Menu Options..............................................................................................................413
Adding A Separator.............................................................................................................417
xiii
Table of Contents
Metrics................................................................................................................................448
Labels.............................................................................................................. 462
Field Labels.........................................................................................................................468
Alignment Tools...................................................................................................................468
Lines...................................................................................................................................468
xiv
Table of Contents
Large Tables.......................................................................................................................469
Navigating In Report Designer............................................................................................469
Null Fields...........................................................................................................................469
Displaying Numeric Values.................................................................................................470
Codeblocks.........................................................................................................................484
Function Pointers................................................................................................................485
The Scope Commands.......................................................................................................485
Assignment Operators........................................................................................................491
Math....................................................................................................................................492
Table of Contents
Shortcuts......................................................................................................... 521
Built-In Functions and Other Commands........................................................ 522
To Copy a File.....................................................................................................................548
Rename a File . ..................................................................................................................549
Deleting a File ....................................................................................................................549
See If a File Exists..............................................................................................................549
To Check Attributes of a File...............................................................................................549
Opening or Creating a File..................................................................................................550
Looping Through a File.......................................................................................................550
Reading From A File...........................................................................................................551
Writing To A File..................................................................................................................551
Date Math...........................................................................................................................556
International Issues.............................................................................................................557
Table of Contents
Overview......................................................................................................... 581
The Right Documentation................................................................................ 581
Header Files.................................................................................................... 582
The EXTERN Statement................................................................................. 582
_app Properties...................................................................................................................605
_app.Methods.....................................................................................................................608
The Application Framewindow............................................................................................608
The Application Framewindows Properties and Methods..................................................610
xvii
Table of Contents
Project.......................................................................................................................................624
File Details..........................................................................................................................625
Log......................................................................................................................................625
DEO....................................................................................................................................625
Inno.....................................................................................................................................625
Adding Files to The Project.................................................................................................625
Getting Started....................................................................................................................626
Add Files.............................................................................................................................627
Start Program......................................................................................................................629
Finishing Touches...............................................................................................................629
Now What?.........................................................................................................................630
Compiling and Building the Application...............................................................................630
Running the Executable in the Same Folder as the Source...............................................631
DEO Folders.......................................................................................................................632
Selecting the DEO Folder For Each File.............................................................................634
The Applications INI File....................................................................................................635
Compile and Build The Application.....................................................................................636
DEO and NON-DEO?.........................................................................................................636
Encrypted Tables................................................................................................................638
Start Your Application Without the Data Engine..................................................................639
Table of Contents
Inno Constants....................................................................................................................662
Using Other Languages......................................................................................................663
xix
Table of Contents
Colors.............................................................................................................. 705
Graphics Issues for Icons and Buttons (Pushbuttons and Toolbuttons).......... 709
Icons...................................................................................................................................709
Images for Pushbuttons......................................................................................................710
Images for Toolbuttons........................................................................................................ 711
xx