| ||||||
FoxPro 2.6 Programming Foundations ClassLesson 1: Introduction to Programming Foundations 1 Introduction 2 Goals for Course 2 Starting FoxPro MS-DOS 3 Differences between FoxPro 2.5 Windows and DOS Versions 3 FoxPro History 6 Student Qualifications 7 Lesson 2: The Data in Database Applications 9 Data as a Building Block 10 FoxPro Databases 10 Record Pointer 12 Models for Data 12 Flat File Model 13 Relational Model 13 Key Fields of Several Kinds 16 One-to-Many Relationships 18 One-to-One Relationships 18 Many-to-Many Relationships 18 More Design Questions: Normalization 19 Dependency 20 Adding Records 20 Deleting Records 20 Changing Key Fields 21 Guidelines for Designing Relationships Among Data 21 Reference (Optional) 23 Lesson 3: Data Access Commands 25 Commands used for Opening and Closing Data Files 26 Shared vs. Exclusive Use 28 What Records do you see? 30 Command <FOR> Clause 32 Controlling the Order of Processing 33 CDX Indexes 33 CDX Indexes 34 Index with FOR 35 The Other Index Type: IDX Indexes 35 Index UNIQUE 36 REINDEX Issues 36 Converting to CDX Index Style 37 CLOSE DATABASE 38 Record Pointer Manipulation Commands 38 Exercise 1: SKIP, GO, EOF(), BOF() 39 GO, SKIP Rules 41 More Index Functions! 42 Using the Master Index to SEEK 43 LOCATE FOR <expL> 46 SCOPE 46 Lesson 4: Relating Tables 49 SET RELATION TO 50 How do You Tell if There are no Matching Records? 52 SET SKIP 53 Two Additional Warnings 53 Exercise 2: Relating Files 53 SET FILTER 56 Lesson 5: Expressions and Variables; Functions 57 Debug Window 58 FoxPro Help 58 FoxPro Syntax Conventions 59 More about the FoxPro Help 61 FoxPro Keywords 61 Expressions 61 Evaluation Order 63 Exercise 3: Numeric Expression Practice within the Debug Window 63 Functions 64 Useful Numeric Functions 64 Lesson 6: Character and Logical Expressions and Functions 69 String Functions 71 Exercise 4: STRTRAN 76 Logical Expressions 79 Logical Operators 79 Relational Operators 80 Logical Functions 81 Logical Comparisons with Strings: EXACT 82 Exercise 5: Logical Expressions 84 Lesson 7: Date Expressions and Functions 87 Dates 88 Dates Functions 89 Lesson 8: Variables and Expressions 93 Variables are created 95 Types of Variables 96 Length of Character Variables 96 Naming of Variables 97 The Scope of Variables 97 Display of Existing Variables 97 Exercise 6: Assignment Statements 98 Exercise 7: Additional Variable Functions 99 Lesson 9: Record Modify Commands 101 Commands that Modify Fields 102 REPLACE 102 SCATTER/GATHER MEMVAR 104 SCATTER MEMVAR BLANK 105 (SQL) INSERT INTO ... FROM MEMVAR 105 Exercise 8: Practice Using Scatter Memvar 106 APPEND BLANK 108 Edit Fields or Memory Variables 108 Recommendations: Edit Memory Variables or Fields 110 Lesson 10: Database Access and Array Actions 113 SCATTER TO <array>/GATHER FROM <array> 114 114 (SQL) INSERT INTO ... FROM <array> 114 Using Arrays or Cursors for Data 115 Recommendations 115 Defining Arrays 117 DIMENSION/DECLARE/PUBLIC 117 PUBLIC 118 SELECT (SQL) TO Array 119 COPY <scope> TO ARRAY <expC> 119 Array Functions 120 Database Structure Functions 122 A Program to create a Copy of a Table 124 A Program to create an array with index information 124 Lesson 11: More Database Commands 127 More Database Commands 128 COPY TO ... 131 Lesson 12: Macro Expansion, Name Expressions 133 Why is This Important? 134 Macro Substitution 134 Name Expressions 135 Lesson 13: Using the FoxPro Editor 139 Opening a Program for Modification 140 Common Operations with the Editor 140 Cut/Copy/Paste text: using the Edit Buffer 141 Marking Text with Clicks 142 Deleting Text 142 Saving the editing session 142 Additional Operations 143 Additional Hints for Using the Editor 144 DO: Executing a Simple Program 144 Exercise 9: Writing a Simple BROWSE Program 145 Lesson 14: Procedures and Functions 147 Calling a Procedure or Function 148 When does the Called Procedure/Function Return? 148 Where does it Return? 149 Location and Identification of the Called Procedure/Function 150 PROGRAM(<expN>) 153 Passing Parameters 153 PARAMETERS() 155 The SCOPE of Variables 155 PUBLIC and RELEASE: Global Variables 156 The SCOPE of Variables in Procedures and Functions 157 Reusable and Defensive Programming 158 Exercise 10: Passing Parameters and Private 159 Another Place for Procedures & Functions 159 Lesson 15: Flow Control Commands 163 IF ... ELSE... ENDIF 164 IIF Immediate IF 165 DO CASE 165 Looping commands 167 SCAN 170 FOR 171 Working with Database Records 171 Lesson 16: FoxPro Screen, Window and Data Command 173 ?, ?? Commands 174 Exercise 11: Hello World Program 175 @ Commands 176 Picture Codes 176 Function Codes 177 Combining Picture and Function Codes 178 @ SAY 179 @ GET 179 @ EDIT Region 180 The READ Command 181 Exercise 12: A Simple Screen Program 182 READ Syntax 183 Lesson 17: FoxPro Window Command 185 Window Commands 186 Lesson 18: FoxPro BROWSE Command 191 BROWSE, EDIT 192 BROWSE Syntax 192 Using BROWSE 193 More about Browse 194 BROWSE FOR, BROWSE KEY 195 Calculated Fields in a BROWSE 196 BROWSE Partition 196 Controlling Data Entry of Character Fields (Optional) 197 The Displayed Width of a Field 199 Displaying Numeric Data 199 Boundaries on Numeric Data 200 Working with Logical Type Data 201 Field Headings 201 Simple data Validation 201 Lesson 19: The FoxPro 2.5 Report Writer 203 When You Work with FoxReport 204 Using the New Printer Driver 205 Programming with The Printer Driver 206 PrintJob.. EndPrintJob 207 Afterward 209 Appendix I: FoxPro 2.5 Keywords 211 Appendix II: FoxPro 2.5 File Extensions 217 Appendix III: Reviews of Additional FoxPro Tools 219 Index 221 |
|