Declare a variable in Block Scope using VB.NET
This article helps you understanding the declaration of variable in block scope.
Variable declaration is a great new way to make your
application performance better like a new feature Block level scope
declaration in this you can declare the variable for entire procedures when all
you need is a counter in a block. The advantage of using block scoped variables
is that they go out of scope once your code exists the block of code in
application .
Example Code
Module
Module1
Sub Main()
Dim A
As Integer
For A = 1 To 5
Dim N
As Long
N = N + A
Next
Dim J As
Integer
For J = 1 To 4
For A = 1
To 5
Dim b
As Long
Console.WriteLine("Value:
{0}", b)
b = b + A
Next
Next
Console.ReadLine()
End
Sub
End Module
OUTPUT

CONCLUSION
In this article you can see how to declare block scope
variable and like the output you saw b retains its value between executions of
the inner loop.