Preface |
|
xv | |
|
Introduction to Object Pascal and the Delphi environment |
|
|
1 | (15) |
|
|
1 | (1) |
|
|
2 | (1) |
|
The Delphi environment and its components |
|
|
2 | (1) |
|
|
3 | (1) |
|
|
4 | (1) |
|
|
5 | (8) |
|
Review of code in Listing 1.1 |
|
|
13 | (1) |
|
|
14 | (2) |
|
|
14 | (2) |
|
|
16 | (30) |
|
A program using simple arithmetic |
|
|
17 | (6) |
|
|
17 | (1) |
|
|
17 | (1) |
|
|
18 | (4) |
|
|
22 | (1) |
|
Identifiers, reserved words and special symbols |
|
|
23 | (5) |
|
|
23 | (1) |
|
|
24 | (1) |
|
|
25 | (1) |
|
|
25 | (1) |
|
|
25 | (1) |
|
|
26 | (1) |
|
|
27 | (1) |
|
|
28 | (1) |
|
Operators with more than one meaning |
|
|
28 | (1) |
|
|
29 | (1) |
|
|
29 | (2) |
|
|
31 | (4) |
|
|
31 | (1) |
|
|
31 | (1) |
|
|
31 | (3) |
|
|
34 | (1) |
|
|
35 | (5) |
|
|
35 | (1) |
|
|
35 | (1) |
|
|
36 | (3) |
|
|
39 | (1) |
|
|
40 | (4) |
|
|
40 | (1) |
|
|
40 | (1) |
|
|
40 | (3) |
|
|
43 | (1) |
|
|
44 | (2) |
|
|
44 | (2) |
|
|
46 | (30) |
|
|
46 | (1) |
|
|
47 | (1) |
|
Simple example using conditionals |
|
|
47 | (6) |
|
|
47 | (1) |
|
|
47 | (6) |
|
|
53 | (1) |
|
|
53 | (4) |
|
|
54 | (1) |
|
|
55 | (1) |
|
|
55 | (2) |
|
General form of if statements |
|
|
57 | (1) |
|
|
57 | (1) |
|
|
58 | (9) |
|
|
58 | (1) |
|
|
58 | (5) |
|
Review of translator code |
|
|
63 | (2) |
|
|
65 | (2) |
|
|
67 | (2) |
|
General form of a case statement |
|
|
68 | (1) |
|
Checking a date for validity |
|
|
69 | (2) |
|
|
69 | (1) |
|
|
69 | (2) |
|
|
71 | (1) |
|
|
71 | (5) |
|
|
71 | (2) |
|
|
73 | (3) |
|
|
76 | (28) |
|
|
76 | (3) |
|
|
76 | (1) |
|
|
76 | (1) |
|
|
76 | (3) |
|
|
79 | (1) |
|
|
79 | (1) |
|
|
80 | (1) |
|
Example of loops with integer counts |
|
|
80 | (8) |
|
|
80 | (1) |
|
|
81 | (1) |
|
|
81 | (1) |
|
Loops with literals and expressions |
|
|
82 | (1) |
|
A loop containing a conditional |
|
|
83 | (2) |
|
|
85 | (1) |
|
|
86 | (2) |
|
|
88 | (1) |
|
Counted loops controlled by characters |
|
|
89 | (1) |
|
|
90 | (1) |
|
|
91 | (2) |
|
|
91 | (1) |
|
|
92 | (1) |
|
|
93 | (11) |
|
|
93 | (1) |
|
|
94 | (10) |
|
|
104 | (27) |
|
|
105 | (1) |
|
|
105 | (1) |
|
An example program -volume and surface area of a box |
|
|
105 | (4) |
|
|
106 | (1) |
|
|
106 | (1) |
|
|
106 | (1) |
|
|
107 | (1) |
|
|
107 | (1) |
|
|
108 | (1) |
|
Arithmetic and real numbers |
|
|
109 | (2) |
|
Real numbers in logical expressions |
|
|
111 | (1) |
|
Real numbers in counted loops |
|
|
112 | (1) |
|
|
112 | (2) |
|
|
114 | (3) |
|
|
114 | (1) |
|
|
114 | (1) |
|
|
115 | (1) |
|
|
115 | (1) |
|
|
116 | (1) |
|
|
117 | (1) |
|
|
117 | (1) |
|
|
118 | (1) |
|
Example program - higher or lower |
|
|
119 | (4) |
|
|
119 | (1) |
|
|
119 | (1) |
|
|
120 | (1) |
|
|
120 | (1) |
|
|
120 | (2) |
|
|
122 | (1) |
|
|
123 | (1) |
|
|
123 | (8) |
|
|
124 | (1) |
|
|
124 | (7) |
|
|
131 | (36) |
|
|
131 | (1) |
|
|
132 | (5) |
|
|
132 | (1) |
|
|
132 | (2) |
|
|
134 | (2) |
|
|
136 | (1) |
|
|
137 | (1) |
|
New version of hangman using arrays |
|
|
138 | (2) |
|
|
140 | (1) |
|
|
140 | (2) |
|
Using an array of floating-point numbers to solve a puzzle |
|
|
142 | (4) |
|
|
142 | (1) |
|
|
143 | (1) |
|
|
143 | (1) |
|
|
144 | (1) |
|
|
145 | (1) |
|
Using a two-dimensional array to solve the chessboard puzzle |
|
|
146 | (2) |
|
|
146 | (1) |
|
|
146 | (1) |
|
|
147 | (1) |
|
|
148 | (4) |
|
|
148 | (1) |
|
|
148 | (1) |
|
|
148 | (2) |
|
|
150 | (1) |
|
|
151 | (1) |
|
|
152 | (15) |
|
|
152 | (1) |
|
|
153 | (14) |
|
|
167 | (24) |
|
|
167 | (2) |
|
Procedures without parameters |
|
|
169 | (2) |
|
Example of parameterless procedures |
|
|
169 | (2) |
|
|
171 | (1) |
|
Parameterless procedures and Memo boxes |
|
|
171 | (2) |
|
|
172 | (1) |
|
|
172 | (1) |
|
|
172 | (1) |
|
|
173 | (1) |
|
Review of the rest of the code |
|
|
173 | (1) |
|
Procedures with constant parameters |
|
|
173 | (3) |
|
Procedure declaration with one parameter |
|
|
173 | (2) |
|
|
175 | (1) |
|
|
176 | (2) |
|
|
176 | (1) |
|
Programmer-defined functions |
|
|
176 | (1) |
|
|
177 | (1) |
|
|
178 | (1) |
|
|
179 | (1) |
|
Parameters of different types |
|
|
179 | (1) |
|
|
180 | (4) |
|
|
181 | (1) |
|
|
181 | (1) |
|
|
181 | (1) |
|
|
182 | (2) |
|
|
184 | (7) |
|
|
184 | (1) |
|
|
185 | (6) |
|
|
191 | (39) |
|
Variables and constant scope |
|
|
192 | (4) |
|
|
192 | (1) |
|
|
192 | (2) |
|
|
194 | (2) |
|
Local declarations and unit-wide identifiers |
|
|
196 | (1) |
|
|
196 | (4) |
|
|
197 | (1) |
|
|
198 | (2) |
|
|
200 | (2) |
|
|
201 | (1) |
|
|
202 | (4) |
|
|
202 | (1) |
|
|
202 | (1) |
|
|
202 | (1) |
|
|
202 | (3) |
|
|
205 | (1) |
|
|
206 | (2) |
|
|
206 | (1) |
|
|
207 | (1) |
|
|
208 | (2) |
|
|
210 | (1) |
|
|
211 | (2) |
|
|
211 | (1) |
|
|
212 | (1) |
|
|
212 | (1) |
|
|
212 | (1) |
|
|
213 | (1) |
|
|
213 | (17) |
|
|
213 | (1) |
|
|
214 | (16) |
|
|
230 | (24) |
|
|
230 | (2) |
|
The repeat construct and a prize distribution problem |
|
|
232 | (3) |
|
|
233 | (1) |
|
|
233 | (1) |
|
Review of data file and code |
|
|
234 | (1) |
|
|
235 | (2) |
|
|
236 | (1) |
|
|
237 | (1) |
|
Counting characters by using a while construct |
|
|
237 | (1) |
|
|
237 | (1) |
|
Distributing prizes again |
|
|
238 | (2) |
|
|
239 | (1) |
|
Non-deterministic loops and arrays |
|
|
240 | (3) |
|
|
240 | (1) |
|
|
241 | (1) |
|
|
241 | (2) |
|
|
243 | (1) |
|
|
243 | (11) |
|
|
244 | (2) |
|
|
246 | (8) |
|
|
254 | (26) |
|
|
255 | (3) |
|
|
255 | (3) |
|
Review of basic Database Desktop facilities |
|
|
258 | (1) |
|
|
258 | (1) |
|
|
259 | (1) |
|
Delphi and the Database Form Wizard |
|
|
260 | (6) |
|
Review of inventory database project |
|
|
264 | (2) |
|
|
266 | (2) |
|
|
268 | (1) |
|
Creating forms for data entry |
|
|
268 | (3) |
|
|
270 | (1) |
|
Calculations from databases |
|
|
271 | (2) |
|
|
273 | (7) |
|
|
273 | (1) |
|
|
274 | (6) |
|
|
280 | (32) |
|
A simple record type for an auction |
|
|
281 | (1) |
|
A record type for weather readings |
|
|
282 | (1) |
|
An example using records for weather data |
|
|
283 | (7) |
|
|
283 | (2) |
|
|
285 | (3) |
|
|
288 | (1) |
|
Further uses of the with construct |
|
|
289 | (1) |
|
|
290 | (1) |
|
Extending the weather program |
|
|
291 | (1) |
|
|
291 | (1) |
|
|
292 | (1) |
|
|
293 | (1) |
|
|
294 | (2) |
|
|
294 | (1) |
|
The theory of drawing the star |
|
|
295 | (1) |
|
|
296 | (16) |
|
|
297 | (1) |
|
|
298 | (14) |
|
Advanced procedures and related concepts |
|
|
312 | (30) |
|
|
313 | (1) |
|
Uninitialized variables and out parameters |
|
|
314 | (1) |
|
Subrange types and Low and High |
|
|
315 | (2) |
|
|
317 | (1) |
|
|
318 | (3) |
|
|
321 | (3) |
|
|
321 | (1) |
|
|
322 | (1) |
|
|
322 | (1) |
|
|
322 | (2) |
|
|
324 | (1) |
|
|
324 | (2) |
|
|
326 | (2) |
|
|
326 | (1) |
|
|
327 | (1) |
|
|
327 | (1) |
|
|
327 | (1) |
|
|
327 | (1) |
|
Event-handling procedures |
|
|
328 | (2) |
|
|
330 | (4) |
|
|
330 | (1) |
|
|
330 | (1) |
|
|
331 | (1) |
|
|
331 | (1) |
|
|
332 | (1) |
|
|
333 | (1) |
|
|
334 | (8) |
|
|
334 | (1) |
|
|
335 | (7) |
|
|
342 | (34) |
|
Compiling, building and running |
|
|
343 | (1) |
|
|
343 | (6) |
|
Double and Extended types |
|
|
344 | (1) |
|
|
345 | (1) |
|
Using the SumOfSquares function |
|
|
345 | (1) |
|
|
345 | (1) |
|
|
346 | (1) |
|
|
346 | (1) |
|
|
346 | (1) |
|
|
347 | (1) |
|
|
348 | (1) |
|
|
348 | (1) |
|
|
349 | (6) |
|
|
349 | (1) |
|
|
349 | (3) |
|
Extending the programmer-defined unit |
|
|
352 | (3) |
|
|
355 | (3) |
|
|
355 | (1) |
|
|
355 | (1) |
|
|
355 | (1) |
|
|
355 | (1) |
|
|
356 | (1) |
|
|
357 | (1) |
|
|
358 | (3) |
|
|
358 | (1) |
|
|
359 | (1) |
|
|
359 | (1) |
|
|
360 | (1) |
|
|
361 | (1) |
|
|
361 | (3) |
|
|
361 | (1) |
|
|
361 | (1) |
|
|
362 | (2) |
|
|
364 | (1) |
|
|
364 | (12) |
|
|
364 | (1) |
|
|
365 | (11) |
|
|
376 | (39) |
|
|
377 | (1) |
|
Top-down design for main event handler |
|
|
377 | (2) |
|
Coding ands testing from the top down |
|
|
379 | (3) |
|
Review of code for main event handler |
|
|
382 | (1) |
|
Coding and testing from the top down, continued |
|
|
382 | (1) |
|
Coding and testing from the bottom up |
|
|
383 | (1) |
|
Further details of interface design |
|
|
384 | (2) |
|
Top-down coding and testing, continued |
|
|
386 | (1) |
|
|
387 | (1) |
|
|
387 | (5) |
|
Review of code for HasFinished |
|
|
392 | (1) |
|
Computer attempts to win, continued |
|
|
393 | (4) |
|
|
397 | (3) |
|
|
400 | (15) |
|
|
400 | (1) |
|
|
401 | (14) |
Appendix A The Object Inspector |
|
415 | (19) |
|
A.1 The Object Inspector window |
|
|
415 | (1) |
|
A.2 Setting properties of a form |
|
|
416 | (2) |
|
|
417 | (1) |
|
A.3 Setting properties of components on a form |
|
|
418 | (1) |
|
|
418 | (1) |
|
|
418 | (1) |
|
|
419 | (1) |
|
|
419 | (1) |
|
|
419 | (1) |
|
|
420 | (2) |
|
|
420 | (1) |
|
|
420 | (1) |
|
|
421 | (1) |
|
|
422 | (1) |
|
A.5.5 Sharing event handlers |
|
|
422 | (1) |
|
A.6 Line drawing extended |
|
|
422 | (6) |
|
|
423 | (1) |
|
A.6.2 Review of the interface |
|
|
423 | (1) |
|
|
424 | (1) |
|
|
425 | (2) |
|
|
427 | (1) |
|
|
428 | (1) |
|
|
428 | (6) |
|
|
429 | (5) |
Appendix B Introduction to Windows 95 onwards including NT |
|
434 | (9) |
|
|
435 | (1) |
|
B.2 Windows Explorer and file management |
|
|
436 | (2) |
|
B.3 Using other programs and copying text |
|
|
438 | (2) |
|
|
440 | (1) |
|
B.4.1 Formatting a floppy disc |
|
|
441 | (1) |
|
B.5 Removable zip discs and rewritable CDs |
|
|
441 | (1) |
|
B.6 Shutting down a computer |
|
|
441 | (1) |
|
|
441 | (1) |
|
|
442 | (1) |
|
|
442 | (1) |
Appendix C Pascal constructs |
|
443 | (8) |
|
|
443 | (1) |
|
|
444 | (1) |
|
C.3 Conditional constructs |
|
|
444 | (1) |
|
|
445 | (1) |
|
C.5 Procedure and function headers |
|
|
446 | (1) |
|
C.6 Using procedures and functions |
|
|
446 | (1) |
|
|
447 | (1) |
|
|
448 | (1) |
|
|
448 | (1) |
|
|
449 | (1) |
|
C.11 Commonly used functions |
|
|
450 | (1) |
Appendix D Glossary |
|
451 | (6) |
Index |
|
457 | |