setfoo"a bc"# 定义变量setb {$a}; # 转义 b的值为"$a",而不是变量结果seta3; incr a3; # 数字的自增. 将a加3,如果要减3,则为 incr a –3;setc [expr20/5]; # 计算 c的值为4 puts $foo; # 打印变量setqian(123) f; # 定义数组setqian(1,1,1) fs; # 多维数组 parray qian; #...
set myarray(1) "One" set myarray(2) "Two" for {set i 0} {$i < 3} {incr i 1} { puts $myarray($i)} Output: Zero One Two Example 7.2: set person_info(name) "Fred Smith" set person_info(age) "25" set person_info(occupation) "Plumber" foreach thing {name age occupation}...
} array set cli $result cli_exec $cli(fd) "enable" set output [cli_exec $cli(fd) "ping 192.168.1.1 repeat 1"] puts $output catch {cli_close $cli(fd) $cli(tty_id)} 0 Helpful Reply Learn, share, save Discover and save your favorite ideas. Come back to expert answers, step-...
如果是,有没有办法在tclsh中运行定制的“put”?EN是时候进行一些语言考古了!Tcl/Tk 是一种大家很少...