Re: TCL Counter
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.tcl archive

Re: TCL Counter

From: Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at>
Date: Tue Dec 13 2005 - 14:50:13 CET

diabolik@uku.co.uk <diabolik@uku.co.uk> wrote:
> Ho do I create a counter that counts between a certain range and once
> the upper limit is reached returns to 0?
> The counter will have to pad value with zeros or spaces to produce a
> field that is 8 characters in size.

proc counter {} {
   while {1} {
      for {set i 0} {$i<100000000} {incr i} {
         puts [format "%08d" $i]
      }
   }
}
counter
Received on Fri Dec 23 19:00:03 2005