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 '-'
精彩评论