Thus said "Sasha Pachev" on Thu, 27 Sep 2007 15:44:45 MDT:

> Given a  string that  could contain  arithmetic expressions,  with the
> addition  that numeric  constants  could be  potentially expressed  as
> times, e.g  1:36 for  96 seconds,  or 2:10:08 for  2 hours  10 minutes
> and  8 seconds,  also  decimal fractions  after  seconds are  allowed,
> e.g  3:45.6 or  3:40:50.67, replace  all  the time  values with  their
> equivalent number of seconds.

The following should be removed from my code snippet starting on line 14
(it was from an experiment I had in the code):

      if {[regexp {(\.\d+)} [lindex $s $x] m]} {
        set z [expr $z + 60 * [scan $m "%f"]]
      }

Andy
--
[-----------[system uptime]--------------------------------------------]
  3:29pm  up  6:24,  1 user,  load average: 1.00, 1.00, 1.00

/*
PLUG: http://plug.org, #utah on irc.freenode.net
Unsubscribe: http://plug.org/mailman/options/plug
Don't fear the penguin.
*/

Reply via email to