Visual Basic 2008 Programming: Business Applications with a Design Perspective
Chapter 1 Chapter 2 Chapter 3 Chapter 4 Chapter 5 Chapter 6 Chapter 7 Chapter 8 Chapter 9
Chapter 10 Chapter 11 Chapter 12 Chapter 13 Chapter 14 Appendix A Appendix B Appendix C Home
Loading
Last change: February 13 2016 18:48:19.

 Chapter in PDF

Table of Contents

Chapter 6: Input, Output, and Procedures
Last change: February 13 2016 18:48:15.
<<PreviousNext>>

6.1 Introduction to Input and Output

When your program starts, the variables in the program must be initialized first either with constants or with values provided from external sources, such as users’ actions (keystrokes or mouse clicks) or an existing file. The process of obtaining data from a source external to the central processing unit (CPU) is referred to as input.
The data that the variables contain are stored in memory. As soon as your program terminates, all these data will no longer exist in the CPU. Some of the data are temporary in nature and can be discarded without any problem. Others, however, need to be displayed (for the user to view their values), printed on a hard copy, or saved in some intermediate storage device, such as hard disks for future uses. The process of sending the data in the CPU to an external device is referred to as output. This section introduces a few possible means that you can use in VB for input and output.
VB provides various ways that your program can obtain input or produce output. Recall in Chapter 3, “Some Visual Basic Controls and Events,” you learned that at least six VB controls could be used to obtain input from the user. A text box, for example, can be used for the user to enter data. Indeed, some of those controls can also be used to display output. For example, you can display any data in the same text box. This section explores three additional ways for input and output:

Last change: February 13 2016 18:48:18.
  1. 6.1 Introduction to Input and Output
    1. The MsgBox Function
    2. Files
    3. File Dialog Boxes
    4. <<PreviousNext>>