开发者

do we have the statement works as if {0} in TCL?

In TCL, I wonder if we have some statements just like if {0} {...}, I mean I do not want to use if {开发者_开发知识库0} {...}, so do we have other alternative?


You can create any command you want to work the same way. In the following example I create a command named "-" that accepts arbitrary arguments and does nothing. The only caveat is that you must use balanced quoting:

proc - args return

- {
    this code/data will not execute
}
- neither will this
- "this won't execute either"

Of course, with those last two examples, variable and command substitution may happen, depending on what follows the '-'

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜