FoxPro 2.6 Application Development
INTRODUCTION vii
LESSON 1: INTRODUCTION TO APPLICATION DEVELOPMENT 1
Our Teaching Method 2
Goals for Course 3
Database Applications Defined 3
Application Functions 4
Applications vs. APP Files 4
FoxPro Power Tools 4
FoxPro History 6
Student Qualifications 8
Your Project 8
LESSON 2: SIMPLE PROJECT 11
The MAIN Program 13
SIMPSCRN Screen Set 14
The SIMPLE Menu 20
Building an APP File 23
Optional Changes 24
LESSON 3: PROJECT BUILDER 25
Model for Project 26
What Gets Stored in a Project? 26
Project Builder Options 27
How to use the Project Builder 29
Guidelines for Working with the Project and Generated Programs 29
The Distribution Kit for MS-DOS: Creating the Executable 32
FoxPro for MS-DOS EXE Flavors 36
FOXR, The Runtime Loader 37
FoxPro for Windows Distribution Kit 33
Build EXE 33
The Setup Wizard 33
Files You May not Distribute 34
Providing a Help System 34
LESSON 4: SCREEN BUILDER WITH MEMORY VARIABLES 39
What happens in our SIMPLE project? 40
How does the Project Manage Screens? 40
Structure of a Screen File 41
A Screen SET 41
Structure of a Screen Program (SPR File) 42
For the Time Being 43
Screen Objects 43
Screen Objects - Windows 44
Selecting a Screen Object - Windows 45
Adjusting the Size of a Screen Window 45
FoxPro Screen Objects - MS-DOS 46
Selecting a Screen Object - MS-DOS 47
Code Supporting the Objects 47
More about @ SAY/GET 49
Character data entry 49
Picture Field: Character Data Only 50
Picture Field: Numbers, either Character or Numeric Data 50
Picture Field: Logical Data Only 51
Picture Field: Numeric Data Only 51
Editing within a Screen: Fields or Memory Variables 51
Steps To Build a Screen 52
Exercise 1: Working with SIMPVAR 52
Back to the Screen: READ 53
How Does the Data Move Between Table and Memory Variables? 53
Ordering GET's, EDIT Regions and Other Objects 54
Exercise 2: The Screen Wizard 56
LESSON 5: OBJECT SNIPPETS: WHEN, VALID CLAUSES 57
Snippets 58
Questions to Ask About Snippets 58
The Basis for the Field Snippets 59
Controlling WHEN Data may be Edited 59
Is the Data VALID: Verification 60
Three Questions for VALID 61
VALID <expL1> | <expN> [ERROR <expC>] 61
Examples of When and Valid Expressions 62
DISABLED/ENABLED 63
RANGE [<expN1>] [,<expN2>] 63
More about SNIPPETS 63
Address Line 1/Address Line 2 64
LESSON 6: PUSH, INVISIBLE, AND RADIO BUTTONS, CHECK BOXES 65
Introduction 66
Push Buttons 67
Invisible Button 69
Radio Buttons 69
Check Boxes 70
LESSON 7: POPUPS, LISTS 73
Popups 74
Adding a POPUP 74
Lists 78
@ ... GET - Invisible Button 80
LESSON 8: VALIDATION, SCREEN SETS AND READ CLAUSES 81
Several levels of validation: 82
Solution: Consists of 3 parts: 82
READ Operation 83
Exercise 3: Build Validation with Instructor 84
Object (Field) Level Snippets 84
READ CLAUSES 85
Execution Order of Read Snippets 85
ADDITIONAL READ CLAUSES 87
Generator Directives 89
More About the Setup Options 89
Event Execution Order 91
Exercise 4: Snippet Order 92
LESSON 9: MENU BUILDER 95
The Menu Builder 96
Quick Menu 96
Steps to Build a Usable Menu 96
Replace, Append, Before, After 98
Additional Menu Commands 98
LESSON 10: RUSHMORE TECHNOLOGY 101
Characteristics of the Index Expressions and the Commands 103
The Potentially Optimizable Expression 104
What is not Optimizable 105
Retrieval of Records 108
CDX Indexes 108
What? Turn OFF Rushmore? 109
8088, 286, 386, 486, SX 109
Extending the Useful Life of Older Equipment 110
LESSON 11 RUNNING FoxPro: CONFIGURATION 111
Running FoxPro Error! Bookmark not defined.
CONFIG.FP, CONFIG.FPW 123
The Non-CONFIG.FP only items are: 129
Finding CONFIG.FP 129
Memory Management 130
FoxPro Performance Overall 131
Memory 131
Network Configuration 133
NETBIOS and Sharing 133
DOS SHARE 133
Novell and 3 Com 134
FILES 135
Novell 3.11 135
Banyan Vines 136
Lantastic 136
Coming Platforms 137
What Version of FoxPro Are You Running? 137
Setting up your Projects 138
Managing the Process 139
FoxPro for Windows Files 139
FoxPro for Macintosh 140
FoxPro for MS-DOS Install 140
Marking Files READONLY/Sharable/Etc. 142
Supplemental Files 143
LESSON 12 ERROR PROCESSING 145
Test to see if using Single User or LAN Version 146
LESSON 13: USING FOXAPP TO GENERATE AN APPLICATION 153
Exercise 5: Using FoxApp with a Single File 154
Elements of the FoxApp Application 159
Modifying the Project 160
Adding Related files to the Project 160
LESSON 14: USING FOXDOC TO CREATE TECHNICAL DOCUMENTATION 161
Exercise 6: Using FoxDoc with COMPDEMO 163
Using SNIPFMT 165
LESSON 15: RE-USE DELETED RECORDS 167
The Problem 168
Physical Nature of Data 168
The Logical Nature of Data 169
Normal Processing using PACK 169
A Solution 170
Does Your Application Need this Trick? 171
LESSON 16: TRANSACTION PROCESSING 173
LESSON 17: MULTI-USER GOALS 177
Goals for Multi-user Applications 178
Sharing the Data: Operating Systems 179
LAN Configurations 182
Multi-user includes LAN and More 186
LESSON 18: EXCLUSIVE VS SHARED USE OF DATA 187
Overview of Multiuser Use of Data 188
Level 1: Exclusive vs. Shared Use 191
Level 2: Shared Use: Read-only vs. Write Access 191
Level 3: Write Access Operations: Locking Others Out 192
LESSON 19: EXCLUSIVE USE OF DATA FILES 195
Opening Files Exclusive vs. Shared Use 196
Exercise 7: USE Command 198
Commands which Require Exclusive Mode 199
Pack/Reindex/Index 200
Append From for DELETED() 201
Exercise 8: USE Command 202
Alert: Situations to Avoid 203
Other (Foreign) File Formats 203
FoxPro 2.0 and Earlier Releases 204
LESSON 20: SHARED USE AND READ-ONLY ACCESS 205
Opening a File for Shared Use 206
Read-Only 206
Performing Read Only Operations 207
Read-only Browse 207
Default ON ERROR/SET REPROCESS 207
Exercise 9: Sharing Data/Read-Only Commands 208
Conclusion and Review 209
LESSON 21: AUTOMATIC LOCKING WITH READ-ONLY COMMANDS 211
Set Lock 212
Set Lock Commands 212
Why This Would be Important 213
Exercise 10: Set Lock ON Commands 213
LESSON 22: BROWSE: AUTOMATIC RECORD LOCKING 215
Locking 216
Exercise 11: BROWSE Command 217
SET REFRESH: How Old is the Data? 218
ON ERROR 218
SET REPROCESS TO 219
ON ERROR Variations 220
Dirty Read 220
One Robust Solution 221
LESSON 23: MANUAL LOCKING AND ERROR RECOVERY 223
Overview 224
Detailed Syntax 225
RLOCK([<expN1> | <expC1>] 225
LOCK() 226
UNLOCK [ALL] 226
Locking Programs 227
When to Lock 229
When to Unlock 230
Additional comments about locking 230
Working with an Error Processing Program 231
LESSON 24: AUTOMATIC LOCKING WITH WRITE ACCESS 233
Write Access Commands 234
Locking Scope for Write Access Commands 234
Manual Locking: What to Do 236
Scope of Command: Why Avoid 237
Pick a Good Time To do Bulk Updates 238
Insert INTO 238
Exercise 12: Write Access Commands 239
LESSON 25: RECORD LOCKS WITH MEMORY VARIABLES 241
Overview 242
STARTUP.PRG 242
SIMPMU.SCX 243
LESSON 26: TRANSACTION PROCESSING, DEADLY EMBRACE 245
Introduction 246
Transaction Processing 246
Deadly Embrace 248
Deadly Embrace of Records 248
Criteria for Solving Deadly Embrace 249
Try and Retry Method 250 LESSON 27: ASSIGNING PRIMARY KEY VALUES 251
Primary Key Values 252
Method 1 - Increasing Numbers 252
Method 2 - A Secondary Database of Keys 253
Lock Original Database 253
A Bad Technique 253
Exercise 13: Adding Primary Key Checking to CompDemo 253
AFTERWARD 255
GLOSSARY 257
|