For all the coding language I know, Variables is a must. It helps everything go smoothly, and thats what Dims are in Vb.Net, it represents Variables.
Now their are different types of Dims, and I will explain them all.
Now the basic dim is the string
Code:
Dim Var1 as String
Var1 = "Hello"
Or
Code:
Dim Var1 as String = "Hello"
You can also dim the sting using a textbox like
Code:
Dim Var1 as String
Var1 = Textbox1.text
Now you might think its not that useful but it is, lets take this for example. We want to put the Date in a message box, you cant just put
Code:
MsgBox(DateTime = Today())
You will get an error, so what you do is this
Code:
Dim TodayDate As DateTime = Today()
MsgBox(TodayDate)
Giving it no error.
Now we have strings down, and custom Values, lets get to the rest.
Boolean
Boolean is a value of only True or False, an example would be
Code:
Dim a As Boolean = True
String
String is just words, a sentence, or a phrase. An example is above and below.
Code:
Dim Sti as String
Sti = "Hello There world!"
Byte
a Byte is an 8 bit unsigned integer, meaning its a data value, and a number.
Code:
Dim fileData As Byte
Char
Char is a variable type. It can hold one character at a time (the Char is short for Character).
Code:
Dim OneCharacter As Char
OneCharacter = "A"
DateTime
DateTime is also a Var type, this one you can go here for all the unique types.
Code:
Dim TodayDate As DateTime = DateTime.Now
MsgBox(TodayDate)
Decimal
Decimals is numbers that aren't full, like 3.24. If you where to use a string for 3.24 it would just read it as 3, and not the full decimal.
Code:
Dim Dec as Decimal
Dec = 3.24
Dim myVar as <data type goes here>
There are afew more but these are the most commonly used. Hope you get the knowledge of Dims now.