Posted to tcl by gwlester at Sat Jan 27 18:59:53 GMT 2018view raw

  1. proc GetInfo {inList target} {
  2. set found no
  3. set results {}
  4. foreach pair $inList {
  5. lassign $pair type value
  6. if {$found && $type ne "LBL"} {
  7. lappend results $pair
  8. } elseif {$found && $type eq "LBL"} {
  9. return $results
  10. } elseif {!$found && $type eq "LBL"} {
  11. set found yes
  12. lappend results $pair
  13. }
  14. }
  15. return $results
  16. }