Public Module Program
Public Sub Main(args() As string)
Console.WriteLine("Hello, World!")
End Sub
End Module
Dim byteVar As Byte
Dim intVar As Integer = 100
Dim doubleVar As Double
Dim dateVar As Date
Dim charVar As Char = "A"
Dim strVar As String = "OneCompiler"
Dim boolVar As Boolean = TRUEt
[ < attributeList > ] [ accessModifier ] [ Shadows ] Const constantName [ As datatype ] = value
Operator type Description
Arithmetic Operator + , - , * , / , , MOD, ^
Relational Operator < , > , <= , >= , =
BitWise Operator AND, OR, XOR, NOT, AndAlso, OrElse, isTrue, isFalse
BitWise Shift Operator AND, OR, XOR, NOT, << , >>
Logical Operator && , ||, !
Assignment Operator = , += , -= , *= , /=, = , %= ,<<=,>>=, &=, ^=
Miscellaneous Operator AddressOf, Await, GetType
Dim variableName As String
Dim Name As String = "harismalik"
If condition-expression Then
'code
End If
If(conditional-expression)Then
'code if the conditional-expression is true
Else
'code if the conditional-expression is false
End If
If(conditional-expression)Then
'code if the above conditional-expression is true
Else If(conditional-expression) Then
'code if the above conditional-expression is true
Else
'code if the above conditional-expression is false
End If
If(conditional-expression)Then
'code if the above conditional-expression is true
If(conditional-expression)Then
'code if the above conditional-expression is true
End If
End If
Select [ Case ] expression
[ Case expressionlist
'code ]
[ Case Else
'code ]
End Select
For counter [ As datatype ] = begin To end [ Step step ]
'code
[ Continue For ]
'code
[ Exit For ]
'code
Next [ counter ]
It is used to concatenate two strings
For Each element [ As datatype ] In group
'code
[ Continue For ]
'code
[ Exit For ]
'code
Next [ element ]
While conditional-expression
'Code
[ Continue While ]
'Code
[ Exit While ]
'Code
End While
Do { While | Until } conditional-expression
'Code
[ Continue Do ]
'Code
[ Exit Do ]
'Code
Loop
Functions consists of a set of statements which perform a sepcific functionality and they return a value when they are called.
[accessModifiers] Function functionName [(parameterList)] As returnType
'code
End Functioncode>
Sub-procedures are similar to functions but they don't return any value.
Sub ProcedureName (parameterList)
'Code
End Sub