1.7.11

Running tcl codes

Running tcl codes requires tclsh
Example $tclsh

Example tcl code to print out values:

# tcl script test for multiple loops
#tcl script test for multiple loops
#purpose: to check the value of val
#
set val 0
set tal 0
set num_apps 1
set num_of_tel_nodes 5
for {set nn 1} {$nn < $num_of_tel_nodes} {incr nn} {
 set tal [expr [expr $nn * $num_apps] + 1]
         for { } {$val < $tal} {incr val} {
            puts stdout  " $val"
        }
}
 puts stdout "###############################"
set num_of_vo_nodes 3
 for {set nn 1} {$nn < $num_of_vo_nodes} {incr nn} {
     set tal [expr [expr [expr $nn * $num_apps] + $num_of_tel_nodes] + 1]
         for { } {$val < $tal} {incr val} {
              puts stdout  " $val"
          }
 }





No comments: