Tcl:命令名称创建
我的 tcl 代码中有一行如下所示:
Application/BitTorrent set seqNo_ $opt(seqNo)
..我有一个 OTcl 类名“Application/BitTorrent”,我收到此错误...
无效的命令名称“Application/BitTorrent” 执行时 “应用程序/BitTorrent 设置 seqNo_ $opt(seqNo)” 谁能告诉我在 tcl 中创建命令的语法或方法?
谢谢!
I have a line in my tcl code like this:
Application/BitTorrent set seqNo_ $opt(seqNo)
..I have an OTcl class name "Application/BitTorrent", I get this ERROR...
invalid command name "Application/BitTorrent"
while executing
"Application/BitTorrent set seqNo_ $opt(seqNo)"
can anybody tell me the syntax or the way to create a command in tcl?
thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不确定 OTcl 语法,但通常对于 OO 风格的 Tcl 扩展来说,它会是这样的:
首先创建类 Application/BitTorrent 的实例,然后在其上使用 set 方法。但是您的错误表明您的课程可能存在一些问题,例如它不可见或类似的问题。您应该使用内省命令(如 [info 命令])或适当的 OTcl 版本检查该类是否确实存在并且名称如您所期望的那样。
No sure about OTcl Syntax, but usually for the OO style Tcl extensions it would be like:
first creating an instance of class Application/BitTorrent and than using the set method on it. But your error indicates there might be some problem with your class, e.g. its not visible or something like that. You should check with introspection commands like [info commands] or the appropriate OTcl versions if the class really exists and is named like you expect it.