how to increment eacl element in a list ?
eg: incrlist {1 2 3}
=>2 3 4
Answer Posted / ch.venkatesh
set list {1 2 3}
for {set i 0} {$i < [llength $list]} {incr i} {
set x [lindex $list $i]
set y [expr $x+1]
puts "$y"
}
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers