代码如下.单独运行,顶部不会以任何方式编译,但底部段编译正常.
proc printbobs {times {textd "cream corn"}} {
for {set r 0} {$r<$times} {incr r}{
puts $textd
}
return $times
}
printbobs 2
Run Code Online (Sandbox Code Playgroud)
proc printText {times2 {textp "hello word"}} {
for {set i 0} {$i<$times2} {incr i} {
puts $textp
}
return $times2
}
printText 2
Run Code Online (Sandbox Code Playgroud)