VBScript:If语句

一个如果语句包括布尔表达式后跟一个或多个语句。如果说条件为True,则执行If条件下的语句。如果条件称为False,则执行If循环之后的语句。

语法

VBScript中If语句的语法是-

If(boolean_expression) Then
   Statement 1
	.....
	.....
   Statement n
End If

流程图

VBScript:If语句

<!DOCTYPE html>
<html>
   <body>
      <script language = "vbscript" type = "text/vbscript">
         Dim a : a = 20
         Dim b : b = 10

         If a > b Then
            Document.write "a is Greater than b"
         End If

      </script>
   </body>
</html>

执行以上代码后,将产生以下结果-

a is Greater than b

作者:terry,如若转载,请注明出处:https://www.web176.com/vbscript/1283.html

(0)
打赏 支付宝 支付宝 微信 微信
terryterry
上一篇 2020年12月10日 下午3:11
下一篇 2020年12月10日 下午3:15

相关推荐

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注