zoukankan      html  css  js  c++  java
  • VBS 控制语句

    1.if...then...end if

    if [条件] then

    [执行语句]

    end if

    可以嵌套 多个if

    if [条件] then

    [执行语句]

    else if [条件] then

    [执行语句]

    end if

    eg.

    Dim a,b

    a=inputbox("please input a")

    b=inputbox("please input b")

    if a>b

    then

    msgbox("a>b")

    else if a<b

    then

    msgbox("a<b")

    end if

    2.select case 变量名

                case 变量值

                        [执行语句]

                case 变量值

                        [执行语句]

    select  case var

              case 1

              msgbox "this is room a"

              case 2

              msgbox "this is room b"

    3. do while

    1) do while 条件

             [执行语句]

        loop

    当想要中途退出循环时,可以使用exit

    2)do

       [执行语句]

       loop while 条件

    先执行语句块,后面判断条件

    4. while 条件

                [执行语句]

        wend

    5. do while 条件

                     [执行语句]

        loop

        until 条件

    6.for i=0 to ubound(Array)

           [执行语句]

        next

    ubound表示数组的最大下标,数组下标从0开始,想要中途退出循环可以使用exit for

    7. for each x in array

            [执行语句]

        next

    想要中途退出循环可以使用exit for

  • 相关阅读:
    关于 JLRoutes
    关于Objection 框架或解耦合方案
    窥探 NSObject
    关于cocoa 运行时runtime
    关于 cocoapods 使用
    关于Xcode 遇到的 警告、错误 处理
    ios 中正则匹配 ,NSPredicate
    关于状态栏 上颜色配置 ios7.x 之后
    使用ios系统侧滑 7.x 之后
    常用的shell脚本
  • 原文地址:https://www.cnblogs.com/wuqm/p/6724224.html
Copyright © 2011-2022 走看看