Variables are used to store data that we want to use in our program. A variable has a name that is used to refer to that piece of data and it also has a type that determines the sort of data that it can store. We create variables using the Dim statement.
Dim Age As Integer Dim Name As String
This declares two variables:
- one called Name which is used to store text
- one called Age which can store a whole number.
There are many different variable types in Visual Basic.
These are the main ones that we will be using:
Can this be
on multiple lines?