[Tutorial] 5# - Dim Statement | Hard
In Visual Basic variables is called "Dim Statement".
Dim statement is one thing you must learn to get somewhere in coding.
Originally Posted by MSDN
In Visual Basic you can use this in many diffrent ways and im going to show/teach you the most used variables.
String
[php]Dim Message as String = "Message HERE"
msgbox(message)[/php]
or:
[php]Dim Message as String = textbox1.text
msgbox(message)[/php]
Boolean
Boolean is a value of only True or False.
[php]Dim A As Boolean = True
If A = True Then
MsgBox("A is " & A.ToString)
End If[/php]
Byte
Originally Posted by MSDN
Use the Byte data type to contain binary data.
The default value of Byte is 0.
[php]Dim BinaryData as byte[/php]
Char
Originally Posted by MSDN
[php]Dim VarChar As Char[/php]
Decimal
Originally Posted by MSDN
[php]Dim Dec As Decimal = 5,3
msgbox(dec)
[/php]
Integer
The Visual Basic Integer variable type is used to store whole numbers between -2,147,483,648 and 2,147,483,648. The Integer variable cannot be used to store numbers containing decimals.
[php]Dim IntegerNumber as integer = 5
msgbox("Number is" & integernumber.tostring)
[/php]
Credits: Techotopica, me, MSDN
Originally Posted by Techotopica
End of tutorial
-Hej
Dim statement is one thing you must learn to get somewhere in coding.
String
[php]Dim Message as String = "Message HERE"
msgbox(message)[/php]
or:
[php]Dim Message as String = textbox1.text
msgbox(message)[/php]
Boolean
Boolean is a value of only True or False.
[php]Dim A As Boolean = True
If A = True Then
MsgBox("A is " & A.ToString)
End If[/php]
Byte
The default value of Byte is 0.
[php]Dim BinaryData as byte[/php]
Char
Decimal
msgbox(dec)
[/php]
Integer
The Visual Basic Integer variable type is used to store whole numbers between -2,147,483,648 and 2,147,483,648. The Integer variable cannot be used to store numbers containing decimals.
[php]Dim IntegerNumber as integer = 5
msgbox("Number is" & integernumber.tostring)
[/php]
Credits: Techotopica, me, MSDN
-Hej