Re: tablelist delete current row



On May 29, 7:22 am, tcltk...@xxxxxxx wrote:
ID No. Last Name First Name
-----------------------------------------------------
1234 Smith John
0070 Bond James
7890 Bauer Jack

Based on the illustration above, how do I loop through the tablelist
to get similar output above? I want to process all the rows and
columns in the tablelist.

set rowcount [.toplevel.mytablelist size] ; # Get number of rows

puts "ID No. Last Name First Name"
puts "-----------------------------------------------------"

# Process all rows in tablelist
for { set i 0 } { $i < $rowcount } { incr i } {
set record [.toplevel.mytablelist rowcget $i -text] ; #
Process a row

set IDNo [ lindex $record 0 ]
set LastName [ lindex $record 1 ]
set FirstName [ lindex $record 2 ]

puts "$IDNo $LastName $FirstName"
}

.



Relevant Pages

  • Re: tablelist delete current row
    ... 1234 Smith John ... 0070 Bond James ... 7890 Bauer Jack ... how do I loop through the tablelist ...
    (comp.lang.tcl)
  • Re: deaf grandma.
    ... puts "Simon says, ... and check the flag each time to see whether we loop again. ... puts "that was in all caps" ...
    (comp.lang.ruby)
  • [SUMMARY] Word Loop (#149)
    ... cheater is a wonderful label for a programmer to have. ... the first priority is to find a possible loop. ... puts before+letter+looplets.shift ...
    (comp.lang.ruby)
  • Re: TCL Need help
    ... I have a simple script like this. ... puts i=$i;set i 11} ... enters into indefinite while loop which according to one of the book ... being evaluated at the beginning leading to an infinite loop. ...
    (comp.lang.tcl)
  • Re: Help With Homework Code
    ... puts "Would you like to Roll or Pass?" ... The empty parentheses are typically omitted. ... you could also simply call 'break' here and use the 'loop' ...
    (comp.lang.ruby)