Presentation is loading. Please wait.

Presentation is loading. Please wait.

Accessing Variables in your project

Similar presentations


Presentation on theme: "Accessing Variables in your project"— Presentation transcript:

1 Accessing Variables in your project
Scope Accessing Variables in your project

2 Block Level If you dimension your variable in a block of code such as if/then, for/next, or select/case, that variable disappears from memory when the block is done

3 Procedure Level If you dimension your variable within a subroutine or function, that variable disappears from memory when the procedure is done

4 Module Level A module is a large block of code identified as a module.
Normally it is it’s own file—but not necessarily. If you dimension your variable in a module, but outside of any subroutine or function, that variable disappears from memory when the module is done. …Unless you dimension it Publicly: Public intMyVariable As Integer Module level variables are good in all blocks and procedures of the Module

5 Procedure Scope You create your subroutines as Public if you wish to share them between code modules Or private if only that module can use it Private Function myFunction()

6 Namespace Level Relevant to large projects that may consist of several VB projects that interact.


Download ppt "Accessing Variables in your project"

Similar presentations


Ads by Google