![]() |
Available news archives:
comp.lang.tcl
-
comp.lang.python
-
comp.security.firewalls
-
sci.crypt -
comp.lang.php -
comp.lang.javascript
|
|
comp.lang.tcl archiveRe: Bug in spinbox
From: Adrian Ho <tcl@03s.net>
Date: Sun Feb 26 2006 - 15:47:02 CET
On 2006-02-26, bgd <bgd73@verizon.net> wrote:
Hmmmm, well, my observations might have been a little harsh, but they're
> Do you know who that is ?
Actually, the full command line that Ulrich posted is:
foreach {day mon year} [clock format [clock seconds] -format "%e %B %Y"] break
Try it in your tclsh.
> The above code is so obviously incorrect it jumped at me. 3 variables same
No, it's correct. I described Ulrich's algorithm earlier, and here it is
>> it takes a single timestamp,
ie. one call to [clock seconds] = <A>
>> formats it into a list-compatible string,
[clock format <A> -format "%e %B %Y"]
Oh, and you don't have to take my word for it. Try this in your tclsh:
puts [llength [clock format [clock seconds] -format "%e %B %Y"]]
For [foreach] to assign the same value to each of day/mon/year, the
>> and uses [foreach] to assign the string-list's elements into the
foreach {day mon year} {26 February 2006} break
> As far as time changing a second after you get it...... In the name of God
Which is exactly the reason why it's possible to get clearly erroneous
>> day=31 mon=December year=2007 # Error = 1 year
>> day=31 mon=January year=2007 # Error = 1 month
(Note that the first error can only happen once a year, but the second
Ulrich's code cannot trigger these errors because it only takes a single
> If you'd like to box it out to relieve a bit of pressure unrelated, I'll let
I apologize if you feel insulted by my previous analysis, but I hope
> Have A nice Day, and clean your damn bifocals.
Now that you mention it, I may be approaching the bifocal point. 8-)
- Adrian
|