Section 3.1. Introduction


3.1. Introduction

In this chapter, we introduce Visual Basic programming with program code and present examples to demonstrate how programs can display messages and obtain information from the user at the keyboard for processing. The first two programs simply display text on the screen. The next obtains two numbers from the user, calculates their sum and displays the result. The accompanying discussion shows you how to perform various arithmetic calculations and save their results for later use. The fourth example demonstrates decision-making fundamentals by showing you how to compare two numbers in various ways, then display messages based on the comparison results. The final example demonstrates how to display text in a special window known as a message dialog.

We introduce console applicationsthat is, applications that do not have a graphical user interface. There are several types of Visual Basic projects (you have already seen Windows applications in Chapter 2); the console application is one of the simplest types. When a console application is executed in Visual Basic 2005 Express, its text output appears in the Console window. A console application can also be executed outside the IDE in a Windows Command Prompt. Programs can input and output information in a variety of ways. For example, in Chapter 2, we created a simple graphical user interface (GUI) for a Windows application, using visual programming techniques. We will briefly return to Windows applications in Chapter 5, Control Statements: Part 1 and Chapter 6, Control Statements: Part 2, respectively. These chapters provide a more detailed introduction to program development in Visual Basic. We discuss Windows applications in detail in Chapter 13, Graphical User Interface Concepts: Part 1 and Chapter 14, Graphical User Interface Concepts: Part 2.



Visual BasicR 2005 for Programmers. DeitelR Developer Series
Visual Basic 2005 for Programmers (2nd Edition)
ISBN: 013225140X
EAN: 2147483647
Year: 2004
Pages: 435

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net