Re: New question on strings



Bryan Oakley wrote:
foreach line <some set of data ...> {
if {<some criteria is met>} {
incr count(<some index>)
}
}

Until your set of data is empty.

Mistakenly doing [incr $counter] is way up on my list along with mistakenly writing code like

proc mapit {list} {
foreach item $list {
lappend result [transform $item]
}
return $result
}

Which, of course, is wrong.

--
Darren New / San Diego, CA, USA (PST)
"That's pretty. Where's that?"
"It's the Age of Channelwood."
"We should go there on vacation some time."
.



Relevant Pages

  • Re: New question on strings
    ... In that time I don't think anybody complained, so it ended up becoming a feature of the language. ... foreach line { ... if {<some criteria is met>} { ... incr count ...
    (comp.lang.tcl)
  • Re: if/endif while/endwhile for/endfor ...
    ... And where would you put the endif in this code: ... set a {incr b} ... San Diego CA USA (PST) ...
    (comp.lang.tcl)