| |
| |
Read Me Before Attempting the Hands-On Exercises | |
| |
| |
| |
Talking with Computers | |
| |
| |
| |
What Computers Do | |
| |
| |
| |
Office Applications | |
| |
| |
| |
Real-Time Control | |
| |
| |
| |
Careers in Programming | |
| |
| |
| |
An Application | |
| |
| |
| |
The Hello World Program | |
| |
| |
| |
Language Translation | |
| |
| |
| |
Source Code and Machine Code | |
| |
| |
| |
Languages and the Operating System Environment | |
| |
| |
| |
Syntax and Syntax Error | |
| |
| |
| |
The Hello World Syntax | |
| |
| |
| |
About the Syntax Errors | |
| |
| |
| |
Learning Syntax | |
| |
| |
| |
The Find Price Program | |
| |
| |
| |
Event-Driven Programming | |
| |
| |
| |
The Program Logic | |
| |
| |
| |
Why Visual Basic? | |
| |
| |
| |
Sample Problem: Extended Hello World | |
| |
| |
| |
Documentation and Comments | |
| |
| |
| |
Troubleshooting: Debugging and Testing | |
| |
| |
Summary | |
| |
| |
Exercises | |
| |
| |
Additional Problem Solving | |
| |
| |
| |
An Introduction to Problem Solving | |
| |
| |
| |
The Software Deliverables | |
| |
| |
| |
Requirements | |
| |
| |
| |
Design | |
| |
| |
| |
Coding | |
| |
| |
| |
User Documentation | |
| |
| |
| |
Case Study: A Conveyor Network | |
| |
| |
| |
Problem-Solving Steps | |
| |
| |
| |
Algorithms | |
| |
| |
| |
Types of Problems | |
| |
| |
| |
Software Life Cycle | |
| |
| |
| |
Structure Chart | |
| |
| |
| |
Flowchart | |
| |
| |
| |
Pseudocode | |
| |
| |
| |
Stepwise Refinement | |
| |
| |
| |
Coding Example: Calculate Labor Cost | |
| |
| |
| |
Sample Problem: Calculate Material Cost | |
| |
| |
| |
Documentation | |
| |
| |
| |
Total Labor Cost Example | |
| |
| |
| |
Total Material Cost Example | |
| |
| |
| |
Troubleshooting: Debugging and Testing | |
| |
| |
| |
Syntax Errors | |
| |
| |
| |
Logical Errors | |
| |
| |
| |
Run-Time Errors | |
| |
| |
Summary | |
| |
| |
Exercises | |
| |
| |
Additional Problem Solving | |
| |
| |
| |
Language Elements | |
| |
| |
| |
The Statement | |
| |
| |
| |
Using Statements | |
| |
| |
| |
Introduction to Debugging | |
| |
| |
| |
Comments | |
| |
| |
| |
Constants and Variables | |
| |
| |
| |
Constants | |
| |
| |
| |
Variables | |
| |
| |
| |
Data Types | |
| |
| |
| |
The Big Picture | |
| |
| |
| |
Common Visual Basic Data Types | |
| |
| |
| |
The Details | |
| |
| |
| |
Operators and Expressions | |
| |
| |
| |
The Assignment Operator | |
| |
| |
| |
Arithmetic Operators | |
| |
| |
| |
A String Operator | |
| |
| |
| |
Keywords | |
| |
| |
| |
Syntax Errors | |
| |
| |
| |
Troubleshooting: Run-Time Errors | |
| |
| |
| |
Sample Problems | |
| |
| |
| |
Unit Conversions from Meters | |
| |
| |
| |
A Simple Thank-You Form Letter | |
| |
| |
| |
Loan Balance | |
| |
| |
| |
Mystery Program | |
| |
| |
Summary | |
| |
| |
Exercises | |
| |
| |
Additional Problem Solving | |
| |
| |
| |
Programming Blocks and Visual Programming | |
| |
| |
| |
Partitioning Modules | |
| |
| |
| |
Structure Charts | |
| |
| |
| |
Procedures | |
| |
| |
| |
Partitioning Into Basic Operations | |
| |
| |
| |
Arguments and Parameters | |
| |
| |
| |
Calling Process | |
| |
| |
| |
Passing Arguments By Reference or By Value | |
| |
| |
| |
Local and Global (Public) Variables | |
| |
| |
| |
Local Variables | |
| |
| |
| |
Global Variables | |
| |
| |
| |
A Business Account Application | |
| |
| |
| |
A Little Bit Under the Hood | |
| |
| |
| |
Programmer-Defined Sub Procedures and Functions | |
| |
| |
| |
Library Functions | |
| |
| |
| |
How to Find Library Function Information--Hands-On Exercise | |
| |
| |
| |
Finding the Sine of an Angle | |
| |
| |
| |
Data Conversion Functions | |
| |
| |
| |
Event Procedures with Visual Programming | |
| |
| |
| |
Introducing Event-Driven Programming | |
| |
| |
| |
The Welcome to Cougar Canoe Program | |
| |
| |
| |
Developing an Event-Driven Visual Basic Program | |
| |
| |
| |
Properties | |
| |
| |
| |
Controls and Control Prefixes | |
| |
| |
| |
Events | |
| |
| |
| |
The Simple Calculator Program | |
| |
| |
| |
Some User Interface Issues | |
| |
| |
| |
Some Technical Talk About Object-Oriented Programming | |
| |
| |
| |
Troubleshooting: Procedure Errors | |
| |
| |
| |
Application Background: Vector Addition | |
| |
| |
| |
The Ground Velocity Application and Finding a Cause of Its Problem | |
| |
| |
| |
Passing Arguments By Value or By Reference | |
| |
| |
| |
Missing Syntax Errors with Argument Problems | |
| |
| |
| |
Avoid Global Variables for Reliability | |
| |
| |
| |
Improve Program Design | |
| |
| |
Summary | |
| |
| |
Exercises | |
| |
| |
Additional Problem Solving | |
| |
| |
| |
Decision Logic | |
| |
| |
| |
The Fundamental Control Structures | |
| |
| |
| |
The Sequence Structure | |
| |
| |
| |
The Selection Structure | |
| |
| |
| |
The Repetition Structure | |
| |
| |
| |
Selection Statements | |
| |
| |
| |
The if then Statement | |
| |
| |
| |
The Equality Comparison Operator (=) and the Assignment Operator (=) | |
| |
| |
| |
Some Other Samples | |
| |
| |
| |
The if then Else Statement | |
| |
| |
| |
Use Indentation | |
| |
| |
| |
Improve the Customer Information System, Version 2 | |
| |
| |
| |
The if then Elself Else Statement | |
| |
| |
| |
Improve the Customer Information System, Version 3 | |
| |
| |
| |
Comparison Operators | |
| |
| |
| |
Presenting the Operators | |
| |
| |
| |
The Boolean Data Type | |
| |
| |
| |
Logic Expressions | |
| |
| |
| |
Order of Precedence | |
| |
| |
| |
Improve the Customer Information System, Version 4 | |
| |
| |
| |
Using the Or Operator | |
| |
| |
| |
A Robot Control Example | |
| |
| |
| |
Nested if then Type Statements | |
| |
| |
| |
Improve the Customer Information System, Version 5 | |
| |
| |
| |
The Select Case Statement | |
| |
| |
| |
Other Selection Functions | |
| |
| |
| |
Choose Function | |
| |
| |
| |
Switch Function | |
| |
| |
| |
IIf Function | |
| |
| |
| |
Input Validation | |
| |
| |
| |
Troubleshooting: Error Trapping | |
| |
| |
| |
Error Handler Routines | |
| |
| |
| |
Inline Error Trapping | |
| |
| |
| |
Application: Parsing Input Text | |
| |
| |
| |
Troubleshooting: Errors in the Ground Velocity Program | |
| |
| |
| |
Detecting Logical Errors | |
| |
| |
| |
Redesign the Program | |
| |
| |
| |
Detecting Run-Time Errors | |
| |
| |
| |
Redesign the Program to Include Error Trapping | |
| |
| |
Summary | |
| |
| |
Exercises | |
| |
| |
Additional Problem Solving | |
| |
| |
| |
Repetition (Arrays and Loops) | |
| |
| |
| |
Arrays | |
| |
| |
| |
Introducing the Array for a Price Information Application | |
| |
| |
| |
Declaration Syntax | |
| |
| |
| |
Two Problem-Solving Exercises | |
| |
| |
| |
Control Arrays | |
| |
| |
| |
Repetition Statements | |
| |
| |
| |
The for Next Statement | |
| |
| |
| |
A Yearly Sales Total Application | |
| |
| |
| |
General Characteristics and Syntax | |
| |
| |
| |
A Factorial Calculation | |
| |
| |
| |
Creating Controls During Run Time | |
| |
| |
| |
The Do...Loop Statement | |
| |
| |
| |
A Find Function for the Yearly Sales Program | |
| |
| |
| |
General Characteristics and Syntax of the Do {While Until} Loop Statement | |
| |
| |
| |
Mathematical Expansions | |
| |
| |
| |
General Characteristics and Syntax of the Do Loop {While Until} Statement | |
| |
| |
| |
The While...Wend Statement | |
| |
| |
| |
An Enter Number Program | |
| |
| |
| |
The KeyPress Event | |
| |
| |
| |
An Engineering Application | |
| |
| |
| |
Understanding the Problem | |
| |
| |
| |
Developing the Algorithm | |
| |
| |
| |
Troubleshooting: The Prototype Program | |
| |
| |
| |
The Picture Box Control | |
| |
| |
| |
Troubleshooting and Loops | |
| |
| |
| |
Fundamental Causes of Loop Problems | |
| |
| |
| |
Using Loops for Generating Test Inputs | |
| |
| |
| |
Array Out of Bounds Error | |
| |
| |
| |
Infinite Loop Problems | |
| |
| |
Summary | |
| |
| |
Exercises | |
| |
| |
Additional Problem Solving | |
| |
| |
| |
Algorithms | |
| |
| |
| |
What is an Algorithm? | |
| |
| |
| |
Overview | |
| |
| |
| |
How to Develop an Algorithm | |
| |
| |
| |
An Alarm Clock | |
| |
| |
| |
A Bit About State Transitions | |
| |
| |
| |
The Timer Control | |
| |
| |
| |
The Data Data Type and Related Functions | |
| |
| |
| |
The Pseudocode | |
| |
| |
| |
The Code for the Alarm Clock Program | |
| |
| |
| |
Amortization Schedule | |
| |
| |
| |
The Pseudocode | |
| |
| |
| |
The Currency Data Type | |
| |
| |
| |
The Code for the Amortization Program | |
| |
| |
| |
The Method of Least Squares | |
| |
| |
| |
The Pseudocode | |
| |
| |
| |
The Visual Basic PSet and Line Methods | |
| |
| |
| |
The Code for the Least Squares Program | |
| |
| |
| |
The Generate Random Data Program | |
| |
| |
| |
The Random Function: Rnd | |
| |
| |
| |
The Pseudocode | |
| |
| |
| |
The List Box Control | |
| |
| |
| |
The Code for the Random Generator Program | |
| |
| |
| |
The Sequential Search Program | |
| |
| |
| |
The Algorithm | |
| |
| |
| |
The Pseudocode | |
| |
| |
| |
Static and ReDim | |
| |
| |
| |
The Selected Property | |
| |
| |
| |
The Code for the Sequential Search Program | |
| |
| |
| |
Binary Search | |
| |
| |
| |
The Binary Search Algorithm | |
| |
| |
| |
The Pseudocode | |
| |
| |
| |
The Code for the Binary Search Program | |
| |
| |
| |
Successive Approximation Algorithm | |
| |
| |
| |
The Diode Circuit Application | |
| |
| |
| |
The Algorithm | |
| |
| |
| |
The Pseudocode | |
| |
| |
| |
The ComboBox | |
| |
| |
| |
Troubleshooting: The Debug Object | |
| |
| |
| |
The Code for the Diode Circuit Program | |
| |
| |
| |
Improving the Numerical Accuracy | |
| |
| |
| |
Selection Exchange Sort | |
| |
| |
| |
A Brief Word About Sorting | |
| |
| |
| |
The Selection Exchange Sort Algorithm | |
| |
| |
| |
The Pseudocode | |
| |
| |
| |
The String Comparison Function StrComp | |
| |
| |
| |
The Code for the Selection Exchange Sort Program | |
| |
| |
| |
DoEvents | |
| |
| |
| |
Bubble Sort | |
| |
| |
| |
The Algorithm and Pseudocode | |
| |
| |
| |
The Code for the Bubble Sort Program | |
| |
| |
Summary | |
| |
| |
Exercises | |
| |
| |
Additional Problem Solving | |
| |
| |
| |
File Handling | |
| |
| |
| |
A Simple Text File Viewer | |
| |
| |
| |
The Common Dialog Control | |
| |
| |
| |
Introduction | |
| |
| |
| |
A Few Technical Notes About the CommonDialog Control | |
| |
| |
| |
The Open File Dialog | |
| |
| |
| |
Menu Controls | |
| |
| |
| |
About Menu Controls | |
| |
| |
| |
Some Menus as To-Be-Implemented Development Examples | |
| |
| |
| |
The Open Menu | |
| |
| |
| |
Processing Files | |
| |
| |
| |
Open and Close Operations | |
| |
| |
| |
Using Sequential Access Files | |
| |
| |
| |
Using Random Access Files | |
| |
| |
| |
Using Binary Access Files | |
| |
| |
| |
The Editor Program | |
| |
| |
| |
User-Defined Data Type and Module Files | |
| |
| |
| |
The Definition and Declaration | |
| |
| |
| |
The Dot Operator for Field Access | |
| |
| |
| |
Standard Module Files | |
| |
| |
| |
The Customer Program, Version 1 | |
| |
| |
| |
The Project Organization and General Declarations | |
| |
| |
| |
Creating the Records | |
| |
| |
| |
Navigation: Viewing the Records | |
| |
| |
| |
Warn the User About Record Changes | |
| |
| |
| |
Customized Message Boxes | |
| |
| |
| |
Troubleshooting: Validate the Inputs | |
| |
| |
| |
Facilitate Keyboard Use to Avoid the Mouse | |
| |
| |
| |
File Menu Operations | |
| |
| |
| |
Looking Ahead | |
| |
| |
Summary | |
| |
| |
Exercises | |
| |
| |
Additional Problem Solving | |
| |
| |
| |
Object and Data Structures | |
| |
| |
| |
Object-Oriented Programming with Class | |
| |
| |
| |
Using a Programmer-Defined Object | |
| |
| |
| |
Defining an Object Class Using a Class Module | |
| |
| |
| |
Private Members | |
| |
| |
| |
Differences Between Standard and Class Modules | |
| |
| |
| |
Adding an Event to a Class Module | |
| |
| |
| |
Class Events with Arguments | |
| |
| |
| |
About Data Structures | |
| |
| |
| |
The Stack | |
| |
| |
| |
The Generic Stack | |
| |
| |
| |
The Modified Method of Least Squares Program | |
| |
| |
| |
A Stack Demonstration | |
| |
| |
| |
The Queue Data Structure | |
| |
| |
| |
The Generic Queue | |
| |
| |
| |
A Queue Demonstration | |
| |
| |
| |
Linked Lists | |
| |
| |
| |
The Generic Linked List | |
| |
| |
| |
A Linked-List Demo for the Customer Program | |
| |
| |
| |
The Linked-List Class | |
| |
| |
Summary | |
| |
| |
Exercises | |
| |
| |
Additional Problem Solving | |
| |
| |
| |
Graphics, Animation, and Multimedia | |
| |
| |
| |
The Reason | |
| |
| |
| |
The Elements | |
| |
| |
| |
Graphic Methods | |
| |
| |
| |
Using Coordinates | |
| |
| |
| |
Color Your World | |
| |
| |
| |
The Graphic Methods Sampler Program | |
| |
| |
| |
The Welcome Program, Version 1 | |
| |
| |
| |
Animation | |
| |
| |
| |
The Butterfly Program | |
| |
| |
| |
The Alarm Clock Program, Version 2 | |
| |
| |
| |
The Welcome Program, Version 2 | |
| |
| |
| |
The Multimedia MCI Control | |
| |
| |
| |
Wave Audio | |
| |
| |
| |
The Alarm Clock Program, Version 3 | |
| |
| |
| |
The Welcome Program, Version 3 | |
| |
| |
| |
Midi Sound and the Welcome Program, Version 4 | |
| |
| |
| |
AVI Video and the Welcome Program, Version 5 | |
| |
| |
| |
The Multimedia Player, Including CD Audio | |
| |
| |
| |
Making Use of the Multimedia Control | |
| |
| |
| |
Setting Up the Media Type | |
| |
| |
| |
Handling Media Playback | |
| |
| |
| |
Handling CD Audio | |
| |
| |
| |
Ending the Program | |
| |
| |
Summary | |
| |
| |
Exercises | |
| |
| |
Additional Problem Solving | |
| |
| |
| |
ActiveX: Object Linking and Embedding (OLE) and Automation | |
| |
| |
A Seminar Information Application | |
| |
| |
An Html-Based Help System Application | |
| |
| |
| |
A Quick Look at Ole in Action | |
| |
| |
| |
Component Ware--a Dream Come True? | |
| |
| |
| |
ActiveX and the Component Object Model (COM) | |
| |
| |
| |
Interaction Between Clients and Components | |
| |
| |
| |
Additional References from External Applications | |
| |
| |
| |
The Ole Container Control | |
| |
| |
| |
The Seminar Program | |
| |
| |
| |
The Design | |
| |
| |
| |
A Seminar Program Using Run-Time Property Settings, Including SourceItem | |
| |
| |
| |
Create an ActiveX Client for Automation | |
| |
| |
| |
The Internet Explorer Automation Program | |
| |
| |
| |
Declaring and Setting Objects | |
| |
| |
| |
Using the Properties and Methods | |
| |
| |
| |
The Web Browser Control | |
| |
| |
Summary | |
| |
| |
Exercises | |
| |
| |
Additional Problem Solving | |
| |
| |
| |
Database Programming | |
| |
| |
| |
The Why and How of Databases | |
| |
| |
| |
Overview | |
| |
| |
| |
The Cougar Canoe Database | |
| |
| |
| |
Data Access Options for Visual Basic | |
| |
| |
| |
The Data Control | |
| |
| |
| |
Structured Query Language (SQL) | |
| |
| |
| |
What Is SQL? | |
| |
| |
| |
Stating a Query | |
| |
| |
| |
The Database Program, Version 2 | |
| |
| |
| |
Other Data-Aware Controls | |
| |
| |
| |
Using Data Access Objects (DAO) | |
| |
| |
| |
Navigating the Database Using DAO | |
| |
| |
| |
Modifying the Database Using DAO | |
| |
| |
| |
Using External Databases | |
| |
| |
| |
External Data Access Choices | |
| |
| |
| |
Attaching External Tables to the Data Control | |
| |
| |
| |
Connecting External Tables to the Data Control | |
| |
| |
| |
Attaching Tables to a Data Access Object | |
| |
| |
| |
Connecting Tables to a Data Access Object | |
| |
| |
| |
ODBC Access | |
| |
| |
| |
ActiveX Data Objects (ADO) | |
| |
| |
| |
Steps in Using ADO | |
| |
| |
| |
ADO Programming Model | |
| |
| |
| |
Basic ADO Example Using the Cougar Canoe Database | |
| |
| |
| |
Data Manipulation Using ADO | |
| |
| |
Summary | |
| |
| |
Exercises | |
| |
| |
Additional Problem Solving | |
| |
| |
| |
Conventions | |
| |
| |
| |
Language Summary | |
| |
| |
| |
Glossary | |
| |
| |
| |
Visual Basic Resources | |
| |
| |
Index | |