Notes | condition | statement conditional statement
Vb. NET conditional statement is still an if then statement and a SELECR case statement.
If then statement
The If then statement is simpler and is the same as the original rule.
Examples of If conditional statements
Public Class Testa
Public Sub New ()
Dim B as Boolean = True
If B = True Then
' Processing
Else
' Processing
End If
End Sub
End Class
Select case
The Select Case statement is used for branching judgment execution of multiple results of a condition. It is worth noting that the Seleect case's judgment expression must be evaluated as a basic data type (Boolean, Byte, Char, Date, Double, Decimal, Integer, Long, Object, short, single, and String).
Vb. NET's case block cannot be "run through" to the next switch section. This is called the "no penetration" rule. So there's no need to break out of the case block.
The case clause can be a single variable, or it can be a mixed expression of to and is.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.