|
|
 |
 |
 |
 |
TCL(Tool Command Language) Scripting
|
 |
 |
 |
 |
 |
 |
 |
 |
%W in the clock command
Greetings, I'm using tcl8.5a4 on windows XP In http://www.tcl.tk/man/tcl8.5/TclCmd/clock.htm#M69 %W is still part of the "clock" command but doesn't seem to work! (bin) 7 % clock format [clock seconds] -format %W can't read "Wweeknumber": no such variable Has %W been taken out in favor of something else? /sd
Hi, sd wrote : > Greetings, > I'm using tcl8.5a4 on windows XP > In http://www.tcl.tk/man/tcl8.5/TclCmd/clock.htm#M69 %W is still part > of the "clock" command but doesn't seem to work! > (bin) 7 % clock format [clock seconds] -format %W > can't read "Wweeknumber": no such variable > Has %W been taken out in favor of something else? > /sd
If %W were no more supported, this would have returned "%W" as output, without raising an error. As error message suggests, this is actually a bug in Tcl 8.5a4 (but a4 means it's alpha after all ;) ) There was a typo in clock.tcl ($Wweeknumber instead of $WweekNumber). This has been fixed in cvs on July 30 2006 (rev 1.31 of clock.tcl), while 8.4a4 has been released in April 2006. 8.5a5 has it fixed. Eric
> There was a typo in clock.tcl ($Wweeknumber instead of $WweekNumber). > This has been fixed in cvs on July 30 2006 (rev 1.31 of clock.tcl), > while 8.4a4 has been released in April 2006. 8.5a5 has it fixed. > Eric
Thanks you Eric. That explains it. /sd
Eric Hassold <hass @evolane.com> writes: > There was a typo in clock.tcl ($Wweeknumber instead of $WweekNumber). Mind blowing! Obviously $Wweeknumber is a typo, but it isn't the typo I had expected!
Donald Arseneau wrote: > Eric Hassold <hass @evolane.com> writes: >>There was a typo in clock.tcl ($Wweeknumber instead of $WweekNumber). > Mind blowing! Obviously $Wweeknumber is a typo, but it isn't > the typo I had expected!
Let me guess: all the VarNames start with their FormatSpecifier to make the mapping clear? uwe
Uwe Klein wrote: > Donald Arseneau wrote: >> Eric Hassold <hass @evolane.com> writes: >>> There was a typo in clock.tcl ($Wweeknumber instead of $WweekNumber). >> Mind blowing! Obviously $Wweeknumber is a typo, but it isn't >> the typo I had expected! > Let me guess: all the VarNames start with their FormatSpecifier > to make the mapping clear?
Not all. But there are three ways for calculating week number: %V, which is what most people want (iso8601WeekNumber) and %U and %W. Since %U and %W both calculate week numbers that don't appear to match any external standards, I couldn't think of more mnemonic names than UweekNumber and WweekNumber. They're pretty obvious in context, since the cases are alphabetised: %U, %V, %W are right in a row doing UweekNumber, iso8601weekNumber, and WweekNumber. -- 73 de ke9tv/2, Kevin
|
 |
 |
 |
 |
|