tcl脚本学习八:while循环的使用

lesson8 :while循环的使用

1. set x 1;
while {$x < 5} {
puts "x is $x";
set x [expr $x + 1]
}
//tcl里面的while 记得以{结束第一行,原因是告诉编译器这段话没结束


2. set x 0;
while "$x < 5" {
set x [expr $x + 1]
if {$x > 7} break;
if "$x > 3" continue;
puts "x is $x";
}
//雷同c语言用法

原文地址:https://www.cnblogs.com/gold-life/p/5731133.html