2

当我尝试在下面的 if 条件中使用该过程时,它不起作用。

proc "isAvailable"{
  bool false
}

loop[val index [int 0]]{

    if[isAvailable]{
          show-alert "Test"
    } else {
          show-alert[ $index |str]
    }
    if [$index | lt 200 ]{
          recur [$index | plus 50]
    }
}

错误消息是Cannot match given parameters to declared parameters at if,但我不明白这个消息。是否需要参数作为过程的输入?

4

1 回答 1

0

可以在没有任何参数的情况下声明过程。

然而,正如名称“proc”所暗示的,它们只是过程:一组没有返回值的命令。

于 2018-08-21T17:08:19.703 回答