Changes

Jump to: navigation, search

Declaring Visual Basic Variables and Constants

311 bytes added, 18:29, 1 August 2007
Understanding Variable and Constant Scope
* Block Level Scope
When a variable or constant is declared in a distinct code structure (such as an ''If'' statement or ''Do loop''), the variable is only visible and accessible to the code within that structure. For example, in the following code the ''intCustCount'' variable is only accessible to code within the ''If'' statement:
<pre>
</pre>
* Procedure Level Scope
Variables and constants declared within a Visual Basic procedure (i.e a Function or Subroutine) are only visible and accessible to code within that procedure. For example, the variable ''intInteretRate'' in the following code is only visible to code within the function:
 <pre>
== Declaring and Referencing Visual Basic Constants ==

Navigation menu