Advanced Search
Mail us
Home    Manuel    Links    Faq    Submit a tcl/tk Reference    Contact Us

    Some examples tcl/tk codes     Man of Bwidget     Man of blt     mkwidget screenshots     TkOgl     Video Demo real.

  Problems with clock command on Windows
 Beware of clock format commands across operating systems 

Tcl`s clock format command eventually passes it`s format string to strftime(). strftime() may have different implementations
depending on the underlying operating system. 

For example, Windows NT 3.51 doesn`t implement the %D, %e, and %h directives. This can have some interesting side effects. 

The bug report: If you do supply one of these unknown directives (and nothing else), Tcl can go into a loop. The FormatClock
routine keeps calling strftime() because it mistakenly assumes that a 0 return must mean that the target buffer is too small.
Indeed, if you just pass it "%e", the strftime() function gets annoyed at it as a directive and erroneously returns 0. Oddly enough
adding a bit of whitespace to the format command gets rid of the loop. 

This may be an NT oddity only, I don`t think you can know for sure that it won`t happen elsewhere. 

-Dave Griffin