Changes

Jump to: navigation, search

Declaring Visual Basic Variables and Constants

404 bytes added, 18:00, 1 August 2007
Initializing Visual Basic Variables
<pre>
Dim strCustomerName As String = "Fred", intInterestRate = 5 As Integer, intExchangeRate As Integer = 10
</pre>
 
== Assigning New Values to Visual Basic Variables ==
 
Once a variable has been declared, a new value can be assigned to the variable at any time using the variable name and the assignment (=) operator. In the following sample Visual Basic code, a variable is declared and initialized to 10. It is then re-assigned the value of 20:
 
<pre>
Dim intInterestRate As Integer = 10
 
intInterestRate = 20
</pre>

Navigation menu