how to increment eacl element in a list ?
eg: incrlist {1 2 3}
=>2 3 4

Answer Posted / yatanti

set incrlist { 1 2 3 }

foreach element $incrlist {
set new_element [ expr $element + 1 ]
lappend new_incrlist $new_element
}
puts $new_incrlist

Is This Answer Correct ?    18 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Hi all, Is there any certification exams available for TCL and Perl. If so please let me know, my mailid is vpbharathi@gmail.com. Thanks in advance, Bharathi.P

2529