O'Reilly logo

Visual Basic 2005 for Programmers: Deitel Developer Series, Second Edition by Harvey M. Deitel - Deitel & Associates, Inc., Paul J. Deitel - Deitel & Associates, Inc.

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

7.14. Scope of Declarations

You have seen declarations of various Visual Basic entities, such as classes, methods, variables and parameters. Declarations introduce names that are used to refer to such entities. A declaration’s Scope is the portion of the program that can refer to the declared entity by its name without qualification. Such an entity is said to be “in scope” for that portion of the program. This section introduces several important scope issues.

The basic scopes are as follows:

  1. Block scope— The scope of a variable declared in a block is from the point of the declaration to the end of the block (e.g., a variable declared in a control statement’s body is in scope only until the end of that control statement).

  2. Method scope— The scope ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required