All pastes #549243 Raw Edit

Untitled

public text v1 · immutable
·published 2007-06-08 01:41 UTC
rendered paste body
var %i = 1
var %seconds = 0
while (%i <= $gettok(%scapeuptime,0,32)) {
  var %word = $gettok(%scapeuptime,%i,32)
  var %qty = $left(%word,-1)
  var %unit = $right(%word,1)
  if (%unit == s) {
    ;we're converting to minutes so this doesn't count
  }
  else if (%unit == m) {
    inc %seconds %qty
  }
  else if (%unit == h) {
    inc %seconds $calc(%qty * 60)
  }
  else if (%unit == d) {
    inc %seconds $calc(%qty * 24)
  }
  inc %i
}