Chapter 5 - VB.NET Language and Syntax - Part 2
Tutorial
What Should Have Been Included in the Book
There are two things that I think should have been included in the discussion in the book.
First - the description of the Imports statement is ... wellllll ... so incomplete that I would have to say that it's actually wrong.
Second - this is the first real introduction to the whole idea of using libraries of objects. It's such a powerful and fundamental idea that I think you should know more about just how powerful and fundamental it is.
The book states that the function of the Imports statement is to "add a library of objects, properties, and methods to your project." Close ... But not quite. The reason is an advanced topic, but I think you should at least be introduced to the whole truth just to prevent misconceptions.
Actually, the way to do what the book states is to add a Reference to your project. If no Reference is available, then it still won't work. In actual fact, the only thing that an Imports statement does is make the Namespace (another advanced topic) available within your code. Another way to say this is that you can reference the objects inside a library by their names without any qualification.
- How to use InputBox and MsgBox as the first examples of function statements
- "Magic" Numbers in the Code
- Trying Out Changes in the Book's Code
- Windows Form Designer Generated Code
- More on Numbers and VB.NET
- Math and Programming
- Examples of the Math Operators
- What Should Have Been Included in the Book
- Qualifying With System.Math
- The Bottom Line!

