📜  VB.Net-决策

📅  最后修改于: 2020-11-19 08:49:09             🧑  作者: Mango


决策结构要求程序员指定一个或多个要由程序评估或测试的条件,以及确定条件为真的情况下要执行的一条或多条语句,以及如果条件被确定为可选的其他执行语句确定为假。

以下是大多数编程语言中常见的典型决策结构的一般形式-

VB.Net中的决策声明

VB.Net提供以下类型的决策声明。单击以下链接以查看其详细信息。

Statement Description

If … Then statement

An If…Then statement consists of a boolean expression followed by one or more statements.

If…Then…Else statement

An If…Then statement can be followed by an optional Else statement, which executes when the boolean expression is false.

nested If statements

You can use one If or Else if statement inside another If or Else if statement(s).

Select Case statement

A Select Case statement allows a variable to be tested for equality against a list of values.

nested Select Case statements

You can use one select case statement inside another select case statement(s).