|
笔记本
|
|
用parse_proc_arguments传递自定义procedure的参数Sync
作者: 走来走去 |
时间: 2019-01-15 22:58:11 |
访问: 78
[更新状态: 成功 (+1)]
如果自己写了一个procedure需要传递参数,用parse_proc_arguments可以方便地将参数赋给一个array变量。
例如:
proc my_proc { args } {
set options(-color) ""
set options(-shape) ""
parse_proc_arguments -args $args options
puts "The color is : $options(-color) "
puts "The shpae is : $options(-shape) "
}
define_proc_attributes my_proc \
-info "trace " \
-define_args { \
{-color "" "" string required} \
{-shape "" "" string optional } \
}
运行结果如下:
icc2_shell> my_proc -color red -shape reg
The color is : red
The shpae is : reg
icc2_shell>
|
| Solvnet Plus | Cadence ASK | SIEMENS EDA(Calibre) | |
| 回到首页 | 时钟 | 联系信箱:yzbox#163.com(把#换成@) |
沪ICP备2026057371号-1
|